/**
 * UAE Knowledge System - Styles
 * Version: 2.3.0
 */

/* ============================================
   BASE STYLES
   ============================================ */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    /* Font stack: Roboto (EN), Noto Sans Arabic (AR), Noto Sans SC (CN) */
    font-family: 'Roboto', 'Noto Sans Arabic', 'Noto Sans SC', sans-serif;
    background-color: #F8F5F0;
    background-image: url('../assets/background.jpg');
    background-position: right top;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #2D3748;
}

/* Language-specific font optimization */
body[dir="rtl"] {
    font-family: 'Noto Sans Arabic', 'Roboto', sans-serif;
}

body.lang-cn {
    font-family: 'Noto Sans SC', 'Roboto', sans-serif;
}

/* ============================================
   COLOR UTILITIES
   ============================================ */
.uae-emerald-deep { background-color: #003d1c; }
.uae-emerald-text { color: #003d1c; }

.gold-fade {
    background: linear-gradient(90deg, #b38e3f 0%, #d4af37 50%, #b38e3f 100%);
}

.gold-button-slender {
    background: linear-gradient(90deg, #b38e3f 0%, #d4af37 50%, #b38e3f 100%);
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gold-button-slender:hover {
    filter: brightness(1.1);
}

/* ============================================
   FALCON LOGO POSITIONING
   ============================================ */
.falcon-overlap-container {
    position: absolute;
    left: 50%;
    top: 60px;
    transform: translate(-50%, -50%);
    z-index: 999;
    pointer-events: none;
}

.falcon-icon {
    height: 100px;
    filter: drop-shadow(0 8px 15px rgba(0,0,0,0.4));
}

/* ============================================
   RESULT CARD STYLES
   ============================================ */
.summary-box {
    background-color: #FDFBF7;
    border: 1px solid #D4AF37;
    border-radius: 4px;
}

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

.result-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* ============================================
   RATING BUTTONS
   ============================================ */
.rating-btn {
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0.4;
}

.rating-btn:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

.rating-btn.active {
    opacity: 1;
    transform: scale(1.15);
}

/* ============================================
   MODAL STYLES
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   CATEGORY DROPDOWN
   ============================================ */
.category-dropdown {
    position: relative;
}

.category-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    min-width: 280px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

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

.category-option {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #1f2937;
    transition: background 0.15s ease;
}

.category-option:hover {
    background: #f3f4f6;
}

.category-option.selected {
    background: #003d1c;
    color: white;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #003d1c;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #002b14;
}

/* ============================================
   LANGUAGE TOGGLE
   ============================================ */
.lang-toggle {
    opacity: 0.7;
}

.lang-toggle:hover {
    opacity: 1;
}

.lang-toggle.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.25);
    font-weight: 700;
}

/* ============================================
   HOME MODE - Centered Search
   ============================================ */
#search-header.home-mode {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 920px;
    padding: 0 1.5rem;
}

#search-header.home-mode + main {
    display: none;
}

/* Results mode - search at top with green background */
#search-header:not(.home-mode) {
    padding-top: 15px;
    padding-bottom: 25px;
}

/* Green banner class for results mode */
.uae-emerald-condensed {
    background-color: #003d1c !important;
    position: relative;
    z-index: 10;
}

/* Note text white on green background in results mode */
.uae-emerald-condensed #first-query-note {
    color: white !important;
}

/* Adjust falcon position for home mode */
body.home-view .falcon-overlap-container {
    position: fixed;
    top: calc(50% - 120px);
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Larger falcon on home page */
body.home-view .falcon-icon {
    height: 130px;
}

/* Hide footer in home mode */
body.home-view footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .falcon-icon {
        height: 60px;
    }

    .falcon-overlap-container {
        top: 45px;
    }

    body.home-view .falcon-overlap-container {
        top: calc(50% - 130px);
    }

    body.home-view .falcon-icon {
        height: 120px;
    }

    /* Search box lower on mobile home view */
    #search-header.home-mode {
        top: calc(50% + 30px);
    }

    /* Category dropdown full width on mobile */
    .category-dropdown-menu {
        left: 0;
        right: 0;
        width: 100%;
        min-width: 100%;
        border-radius: 0 0 8px 8px;
        max-height: 50vh;
        overflow-y: auto;
    }

    .category-option {
        padding: 8px 12px;
        font-size: 14px;
    }

    /* Modal full width on mobile */
    .modal-content {
        max-width: 95%;
        max-height: 85vh;
        margin: 0.5rem;
    }
}