/* Remove duplicate font import - handled in base.html */

/* Utility classes for visibility - Manager favorites specific */
.manager-favorites-hidden {
    display: none !important;
}

/* Swiper Navigation Styles */
.swiper-button-prev,
.swiper-button-next {
    color: white !important;
    background: rgba(0, 0, 0, 0.5) !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    margin-top: -20px !important;
    transition: all 0.3s ease !important;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: rgba(0, 136, 204, 0.8) !important;
    transform: scale(1.1);
}

.swiper-button-prev:after,
.swiper-button-next:after {
    font-size: 16px !important;
    font-weight: bold !important;
}

.swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5) !important;
    opacity: 0.5 !important;
}

.swiper-pagination-bullet-active {
    background: #0088CC !important;
    opacity: 1 !important;
}

/* Property slider specific styles */
.property-slider {
    position: relative !important;
}

.property-slider .swiper-button-prev,
.property-slider .swiper-button-next {
    color: white !important;
    background: rgba(0, 0, 0, 0.6) !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
    z-index: 20 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    visibility: visible !important;
    opacity: 0.8 !important;
}

.property-slider .swiper-button-prev:after,
.property-slider .swiper-button-next:after {
    font-size: 16px !important;
    font-weight: bold !important;
}

.property-slider .swiper-button-prev {
    left: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-top: 0 !important;
}

.property-slider .swiper-button-next {
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-top: 0 !important;
}

.property-slider .swiper-button-prev:hover {
    background: rgba(0, 136, 204, 0.9) !important;
    transform: translateY(-50%) scale(1.1) !important;
    box-shadow: 0 6px 16px rgba(0, 136, 204, 0.4) !important;
}

.property-slider .swiper-button-next:hover {
    background: rgba(0, 136, 204, 0.9) !important;
    transform: translateY(-50%) scale(1.1) !important;
    box-shadow: 0 6px 16px rgba(0, 136, 204, 0.4) !important;
}

.property-slider .swiper-pagination {
    bottom: 12px !important;
    z-index: 10 !important;
}

.property-slider .swiper-pagination-bullet {
    background: rgba(0, 0, 0, 0.4) !important;
    color: white !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    margin: 0 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    opacity: 0.6 !important;
}

.property-slider .swiper-pagination-bullet:hover {
    background: rgba(0, 136, 204, 0.8) !important;
    transform: scale(1.1) !important;
    opacity: 1 !important;
}

.property-slider .swiper-pagination-bullet-active {
    background: #0088CC !important;
    transform: scale(1.2) !important;
    opacity: 1 !important;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.4) !important;
}

/* Красивые переходы между слайдами */
.property-slider .swiper-slide {
    transition: opacity 0.6s ease-in-out !important;
}

.property-slider .swiper-slide img {
    transition: transform 0.2s ease !important;
}

.property-slider:hover .swiper-slide img {
    transform: scale(1.01) !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    scroll-behavior: smooth;
    /* Improve text rendering on all devices */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.gradient-bg {
    background: rgb(110 69 226 / var(--tw-bg-opacity, 1));
}

/* Remove duplicate .typewriter definition */

.typewriter {
    background: linear-gradient(135deg, #0088CC 0%, #006699 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.gradient-text {
    background: linear-gradient(to right, #0088CC, #006699);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Убрано - заменено на ::after псевдоэлемент */

/* Typewriter как на inback.ru */
.typewriter {
    display: inline-block;
    position: relative;
    font-weight: 900;
    font-size: 3.75rem;
    min-height: 4.5rem;
    line-height: 1.2;
}

.typewriter::after {
    content: "|";
    position: absolute;
    right: -8px;
    animation: blink 0.7s infinite;
    color: #000000;
}

/* Optimized property cards with hardware acceleration */
.property-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
    transform: translateZ(0); /* Force hardware acceleration */
}

.property-card:hover {
    transform: translateY(-5px) translateZ(0);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Mobile-first responsive optimizations */
@media (max-width: 768px) {
    .property-card:hover {
        transform: none; /* Disable hover effects on mobile for better performance */
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
}

.search-box {
    box-shadow: 0 10px 25px rgba(0, 136, 204, 0.2);
}

.loading-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #6e45e2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeOut 0.5s 2s forwards;
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

/* Mobile Navigation Improvements */
.mobile-dropdown-content {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 0;
    overflow: hidden;
}

.mobile-dropdown-content:not(.hidden) {
    max-height: 300px;
}

/* Touch-friendly button sizes for mobile */
@media (max-width: 768px) {
    .mobile-dropdown-btn {
        min-height: 44px; /* iOS recommended touch target size */
        padding: 12px 16px;
    }
    
    .nav-link {
        min-height: 44px;
        padding: 12px 16px;
    }
}

/* Improved scroll performance */
* {
    -webkit-overflow-scrolling: touch;
}

/* Optimize images for faster loading */
img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* Critical loading optimizations */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

/* Favorites System Styles */
.favorite-heart {
    position: relative;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 10;
}

.favorite-heart:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.favorite-heart i {
    color: #9ca3af;
    font-size: 18px;
    transition: all 0.3s ease;
}

.favorite-heart.favorited i {
    color: #ef4444;
    transform: scale(1.2);
}

.favorite-heart.pulse {
    animation: heartPulse 1.5s infinite;
}

.favorite-heart.animate-click {
    animation: heartClick 0.3s ease;
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes heartClick {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Floating hearts animation */
.floating-heart {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    color: #ef4444;
    font-size: 16px;
    animation: floatUp 2s ease-out forwards;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.5);
    }
}

/* Favorites counter in header */
.favorites-counter .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.favorites-counter .badge.show {
    opacity: 1;
    transform: scale(1);
}

.favorites-counter .badge.pulse {
    animation: badgePulse 0.6s ease;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.lazy-load.loaded {
    opacity: 1;
}

/* Responsive typography */
@media (max-width: 640px) {
    h1 { font-size: 1.875rem; line-height: 2.25rem; }
    h2 { font-size: 1.5rem; line-height: 2rem; }
    h3 { font-size: 1.25rem; line-height: 1.75rem; }
    
    .text-4xl { font-size: 1.875rem !important; }
    .text-3xl { font-size: 1.5rem !important; }
    .text-2xl { font-size: 1.25rem !important; }
}

/* Performance improvements for animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes ping {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.animate-ping {
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animation-delay-200 {
    animation-delay: 0.2s;
}

.animation-delay-400 {
    animation-delay: 0.4s;
}

/* Dropdown styles */
.dropdown {
    position: relative;
}

.dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    color: #374151;
    font-weight: 500;
}

.dropdown-btn:hover {
    background-color: #f3f4f6;
    color: #6e45e2;
}

.dropdown-btn svg {
    width: 1rem;
    height: 1rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 12rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 50;
}

.dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
    color: #6e45e2;
}

.dropdown-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 8px 0;
}

.dropdown-item svg {
    width: 1rem;
    height: 1rem;
    color: #6b7280;
}

@keyframes ping {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.animate-ping {
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animation-delay-200 {
    animation-delay: 0.2s;
}

.animation-delay-400 {
    animation-delay: 0.4s;
}

.modal {
    transition: opacity 0.3s ease;
}

.step-item:not(:last-child):after {
    content: '';
    position: absolute;
    right: -2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4rem;
    height: 2px;
    background: rgb(110 69 226 / var(--tw-bg-opacity, 1));
}

/* Carousel dots */
.carousel-dot {
    transition: all 0.3s ease;
}
.carousel-dot.active {
    opacity: 1;
    transform: scale(1.3);
}

/* Map and object card styles */
.map-container {
    width: 100%;
    height: 100%;
    min-height: 500px;
}

.object-card {
    transition: all 0.2s ease;
}

.object-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.filter-pill {
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: white;
    color: #374151;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-pill:hover {
    background: #f3f4f6;
}

.filter-pill.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.dropdown-btn:hover {
    background: rgba(0, 136, 204, 0.1);
}

.dropdown-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.dropdown-btn.open svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease-out;
    pointer-events: none;
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-menu.open,
.group:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.dropdown-item:hover {
    background-color: rgba(0, 136, 204, 0.05);
}

input[type="checkbox"]:checked {
    background-color: rgb(0, 136, 204);
    border-color: rgb(0, 136, 204);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    color: #141A24;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: rgba(110, 69, 226, 0.1);
    color: #6e45e2;
}

.dropdown-item svg {
    width: 14px;
    height: 14px;
}

/* Selected filters */
.selected-filter {
    background-color: #f5f3ff;
    color: #6d28d9;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
}

/* Footer menu styles */
.footer-menu-group {
    margin-bottom: 1.5rem;
}

.footer-submenu {
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .footer-submenu {
        display: block !important;
    }
}

@media (max-width: 768px) {
    .step-item:not(:last-child):after {
        display: none;
    }
}

.nav-link {
    color: #141A24;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
}

.nav-link:hover {
    background: rgba(0, 136, 204, 0.1);
}

/* ================================
   GAMIFICATION CASHBACK POPUP
   ================================ */

/* Main popup container */
.cashback-popup {
    position: fixed;
    left: -400px;
    bottom: 20px;
    width: 350px;
    max-width: calc(100vw - 40px);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 136, 204, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(0, 136, 204, 0.2);
    z-index: 10000;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

.cashback-popup.show {
    left: 20px;
    transform: scale(1);
}

.cashback-popup.pulse {
    animation: popupPulse 2s infinite ease-in-out;
}

/* Close button */
.cashback-popup .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #64748b;
    font-size: 18px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 10001;
}

.cashback-popup .close-btn:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Header with wallet icon */
.cashback-popup .popup-header {
    padding: 24px 20px 16px 20px;
    position: relative;
    background: linear-gradient(135deg, #0088CC 0%, #006699 100%);
    color: white;
    text-align: center;
    overflow: hidden;
}

.cashback-popup .popup-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s linear infinite;
}

.cashback-popup .wallet-icon {
    font-size: 48px;
    margin-bottom: 8px;
    display: inline-block;
    animation: walletBounce 2s ease-in-out infinite;
    position: relative;
}

/* Падающие монетки из кошелька */
.cashback-popup .coin {
    position: absolute;
    color: #fbbf24;
    font-size: 16px;
    animation: coinFall 2s ease-in infinite;
    opacity: 0;
}

.cashback-popup .coin:nth-child(1) { left: 45%; animation-delay: 0s; }
.cashback-popup .coin:nth-child(2) { left: 55%; animation-delay: 0.3s; }
.cashback-popup .coin:nth-child(3) { left: 50%; animation-delay: 0.6s; }
.cashback-popup .coin:nth-child(4) { left: 40%; animation-delay: 0.9s; }
.cashback-popup .coin:nth-child(5) { left: 60%; animation-delay: 1.2s; }

.cashback-popup .popup-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Content area */
.cashback-popup .popup-content {
    padding: 20px;
    text-align: center;
}

.cashback-popup .popup-text {
    font-size: 14px;
    color: #475569;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.cashback-popup .highlight-text {
    color: #0088CC;
    font-weight: 600;
}

/* Action button */
.cashback-popup .action-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #0088CC 0%, #006699 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.cashback-popup .action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.cashback-popup .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.4);
}

.cashback-popup .action-btn:hover::before {
    left: 100%;
}

.cashback-popup .action-btn:active {
    transform: translateY(0);
}

/* Progress bar */
.cashback-popup .progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #0088CC;
    width: 0%;
    transition: width 10s linear;
}

.cashback-popup.show .progress-bar {
    width: 100%;
}

/* ===== ANIMATIONS ===== */

/* Popup pulse animation */
@keyframes popupPulse {
    0%, 100% { 
        box-shadow: 0 20px 40px rgba(0, 136, 204, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
    }
    50% { 
        box-shadow: 0 25px 50px rgba(0, 136, 204, 0.25), 0 12px 24px rgba(0, 0, 0, 0.15);
        transform: scale(1.02);
    }
}

/* Wallet bounce animation */
@keyframes walletBounce {
    0%, 20%, 50%, 80%, 100% { 
        transform: translateY(0) rotate(0deg);
    }
    10% { 
        transform: translateY(-8px) rotate(-5deg);
    }
    40% { 
        transform: translateY(-6px) rotate(3deg);
    }
    60% { 
        transform: translateY(-4px) rotate(-2deg);
    }
}

/* Falling coins animation */
@keyframes coinFall {
    0% { 
        opacity: 1;
        transform: translateY(-10px) rotate(0deg) scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: translateY(30px) rotate(180deg) scale(0.8);
    }
    100% { 
        opacity: 0;
        transform: translateY(60px) rotate(360deg) scale(0.6);
    }
}

/* Shimmer effect */
@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* ===== MOBILE RESPONSIVE ===== */

@media (max-width: 768px) {
    .cashback-popup {
        width: 320px;
        left: -350px;
        bottom: 10px;
    }
    
    .cashback-popup.show {
        left: 10px;
    }
    
    .cashback-popup .popup-header {
        padding: 20px 16px 12px 16px;
    }
    
    .cashback-popup .wallet-icon {
        font-size: 40px;
    }
    
    .cashback-popup .popup-title {
        font-size: 16px;
    }
    
    .cashback-popup .popup-content {
        padding: 16px;
    }
    
    .cashback-popup .popup-text {
        font-size: 13px;
    }
    
    .cashback-popup .action-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .cashback-popup {
        width: 280px;
        left: -300px;
    }
    
    .cashback-popup.show {
        left: 10px;
    }
}

/* Hide on very small screens */
@media (max-width: 320px) {
    .cashback-popup {
        display: none;
    }
}