/* EMERGENCY PROFESSIONAL UPGRADE FOR TORG-AI.RU 
   Based on MCP vectored knowledge - Claude Code mastery
   Date: August 17, 2025
   Target: Professional quality 95%+
*/

/* ===== NUCLEAR OVERRIDE - PROFESSIONAL 2025 STANDARDS ===== */

/* PROFESSIONAL FILTER BUTTONS - 8PX GRID SYSTEM */
.filter-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 2px solid rgba(243, 159, 27, 0.4) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    padding: 16px 24px !important; /* 8px grid system */
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 14px !important;
    font-weight: 600 !important; /* Professional weight */
    min-height: 48px !important; /* Touch-friendly */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    backdrop-filter: blur(12px) !important; /* Glassmorphism */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}

.filter-btn:hover {
    border-color: rgba(243, 159, 27, 0.9) !important;
    color: #ffffff !important;
    background: rgba(243, 159, 27, 0.2) !important;
    transform: translateY(-3px) scale(1.02) !important; /* Professional lift */
    box-shadow: 0 8px 24px rgba(243, 159, 27, 0.35) !important;
}

.filter-btn.active {
    border-color: #F39F1B !important;
    color: #000000 !important; /* Black text on orange */
    background: linear-gradient(135deg, #F39F1B 0%, #ff8c00 100%) !important;
    box-shadow: 0 8px 32px rgba(243, 159, 27, 0.5) !important;
    font-weight: 700 !important;
    transform: translateY(-2px) scale(1.05) !important;
}

/* PROFESSIONAL SEARCH DROPDOWNS - NUCLEAR UPGRADE */
.filter-dropdown {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid rgba(243, 159, 27, 0.5) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    padding: 16px 24px !important; /* Better padding */
    border-radius: 8px !important;
    font-size: 15px !important; /* Larger text */
    font-weight: 600 !important;
    min-height: 52px !important; /* Bigger touch target */
    width: 160px !important; /* Fixed width for consistency */
    backdrop-filter: blur(16px) !important; /* More blur */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3) !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    appearance: none !important; /* Remove default styling */
    position: relative !important;
}

.filter-dropdown:hover, .filter-dropdown:focus {
    border-color: rgba(243, 159, 27, 0.9) !important;
    background: rgba(243, 159, 27, 0.15) !important;
    box-shadow: 0 8px 24px rgba(243, 159, 27, 0.35) !important;
    transform: translateY(-2px) !important;
    color: #ffffff !important;
}

/* Custom dropdown arrow */
.filter-dropdown {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%23F39F1B' d='M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
    padding-right: 40px !important;
}

/* PROFESSIONAL SEARCH BUTTON */
.search-btn {
    background: linear-gradient(135deg, #F39F1B 0%, #ff8c00 100%) !important;
    border: none !important;
    color: #000000 !important; /* Black text for contrast */
    padding: 16px 32px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    min-height: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 6px 20px rgba(243, 159, 27, 0.4) !important;
    text-shadow: none !important;
}

.search-btn:hover {
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow: 0 10px 30px rgba(243, 159, 27, 0.6) !important;
    background: linear-gradient(135deg, #ff8c00 0%, #F39F1B 100%) !important;
}

/* PROFESSIONAL PROPERTY STATISTICS */
.property-statistics {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(243, 159, 27, 0.3) !important;
    border-radius: 16px !important;
    padding: 24px !important;
    backdrop-filter: blur(16px) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    margin: 24px 0 !important;
    font-weight: 600 !important;
}

.stat-number {
    color: #F39F1B !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* RESPONSIVE MOBILE OPTIMIZATION */
@media (max-width: 768px) {
    .live-ticker {
        padding: 8px 16px 8px 70px !important;
        font-size: 12px !important;
    }
    
    /* MOBILE STATISTICS SECTION - MAKE VISIBLE */
    .property-statistics {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 16px !important;
        margin: 16px 0 !important;
        font-size: 12px !important;
        text-align: center !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: rgba(243, 159, 27, 0.1) !important;
        border: 2px solid rgba(243, 159, 27, 0.3) !important;
    }
    
    .stat-number {
        font-size: 18px !important;
        font-weight: 700 !important;
        color: #F39F1B !important;
    }
    
    .filter-group {
        gap: 4px !important;
        /* CRITICAL FIX: Better grid layout for filters */
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)) !important;
        width: 100% !important;
    }
    
    /* SPECIFIC FIX: Shorter text for long filter button */
    .filter-btn[data-filter="freeuse"] {
        font-size: 10px !important;
        padding: 6px 4px !important;
        /* Alternative shorter text via CSS */
    }
    
    .filter-btn {
        padding: 8px 8px !important;
        font-size: 11px !important;
        min-height: 40px !important;
        /* CRITICAL FIX: Better text wrapping for long buttons */
        word-break: break-word !important;
        line-height: 1.2 !important;
        text-align: center !important;
    }
    
    .view-toggle {
        justify-content: center !important;
    }
    
    .view-btn {
        min-height: 44px !important;
        width: 44px !important;
        height: 44px !important;
    }
}

@media (max-width: 480px) {
    .filter-btn {
        padding: 8px 8px !important;
        font-size: 11px !important;
        min-height: 40px !important;
        /* CRITICAL FIX: Better text wrapping for long buttons */
        word-break: break-word !important;
        line-height: 1.2 !important;
        text-align: center !important;
    }
    
    .filter-group {
        gap: 4px !important;
        /* CRITICAL FIX: Better grid layout for filters */
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)) !important;
        width: 100% !important;
    }
    
    /* SPECIFIC FIX: Shorter text for long filter button */
    .filter-btn[data-filter="freeuse"] {
        font-size: 10px !important;
        padding: 6px 4px !important;
        /* Alternative shorter text via CSS */
    }
}

/* PROFESSIONAL FOOTER REDESIGN */
.footer {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(48, 49, 45, 0.9) 100%) !important;
    border-top: 2px solid rgba(243, 159, 27, 0.3) !important;
    padding: 40px 0 !important;
    backdrop-filter: blur(20px) !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4) !important;
}

.footer-content {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    gap: 32px !important;
    align-items: center !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
}

.footer-logo .logo-text {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
}

.footer-logo .logo-accent {
    color: #F39F1B !important;
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 14px !important;
    margin-top: 8px !important;
    font-weight: 500 !important;
}

.footer-contact h4 {
    color: #F39F1B !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    margin-bottom: 16px !important;
}

.footer-contact a {
    display: block !important;
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.footer-contact a:hover {
    color: #F39F1B !important;
    transform: translateX(4px) !important;
}

.footer-legal {
    text-align: right !important;
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

/* PROFESSIONAL PHOTO MODAL UPGRADE */
.photo-modal {
    background: rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(24px) !important;
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 10000 !important;
    align-items: center !important;
    justify-content: center !important;
}

.photo-modal.active {
    display: flex !important;
}

.photo-modal-content {
    position: relative !important;
    max-width: 90vw !important;
    max-height: 90vh !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px !important;
    padding: 24px !important;
    backdrop-filter: blur(20px) !important;
    border: 2px solid rgba(243, 159, 27, 0.3) !important;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.8) !important;
}

.photo-modal-image {
    width: 100% !important;
    height: auto !important;
    max-height: 70vh !important;
    object-fit: contain !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
}

.photo-modal-close {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    background: rgba(243, 159, 27, 0.9) !important;
    color: #000000 !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

.photo-modal-close:hover {
    background: #F39F1B !important;
    transform: scale(1.1) rotate(90deg) !important;
    box-shadow: 0 6px 20px rgba(243, 159, 27, 0.6) !important;
}

.photo-modal-nav {
    position: absolute !important;
    top: 50% !important;
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    padding: 0 16px !important;
    pointer-events: none !important;
}

.photo-nav-btn {
    background: rgba(243, 159, 27, 0.9) !important;
    color: #000000 !important;
    border: none !important;
    border-radius: 50% !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    pointer-events: all !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
}

.photo-nav-btn:hover {
    background: #F39F1B !important;
    transform: scale(1.2) !important;
    box-shadow: 0 8px 24px rgba(243, 159, 27, 0.6) !important;
}

/* NUCLEAR OVERRIDE FOR IMMEDIATE EFFECT */
* {
    box-sizing: border-box !important;
}

/* HIDE SKIP LINKS COMPLETELY - NUCLEAR FIX */
.skip-link {
    position: absolute !important;
    top: -100px !important; /* Far off screen */
    left: -100px !important; /* Far off screen */
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    z-index: -9999 !important;
}

.skip-link:focus {
    position: fixed !important;
    top: 8px !important;
    left: 8px !important;
    width: auto !important;
    height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: visible !important;
    clip: auto !important;
    z-index: 99999 !important;
    background: #F39F1B !important;
    color: #000000 !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}