/* =========================================
   1. GLOBAL NAVIGATION & LINKS
   ========================================= */

/* Fix: Only apply underline style to text links, NOT buttons/nav items */
p a, li a, .contact-box a {
    color: var(--brand-primary, #059669);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    font-weight: 500;
    transition: all 0.2s;
}

p a:hover, li a:hover, .contact-box a:hover {
    color: var(--brand-secondary, #0f3443);
    border-bottom-color: var(--brand-secondary, #0f3443);
}

/* Global Nav Container */
.global-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-medium, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

/* Left Section (Back Button + Logo) */
.global-nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Divider Line */
.global-nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border-medium, #e2e8f0);
}

/* Logo */
.global-nav-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
}

/* Back Button (Clean UI - No Underline) */
.global-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none; 
    border: 1px solid transparent; 
    border-bottom: none !important; /* CRITICAL FIX for image_57edc7.png */
    color: var(--text-subtle, #64748b);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.global-back-btn:hover {
    background-color: var(--bg-surface, #f8fafc);
    color: var(--brand-primary, #059669);
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.global-back-btn:active {
    transform: translateY(0);
}

/* =========================================
   2. LANGUAGE DROPDOWN (Fix for image_570969.png)
   ========================================= */
.lang-dropdown-wrapper {
    position: relative;
    z-index: 1001;
}

.lang-trigger {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-medium, #e2e8f0);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main, #1e293b);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Hover State */
.lang-trigger:hover {
    border-color: var(--brand-primary, #059669);
    background: var(--bg-surface, #f8fafc);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Active State (When menu is open) */
.lang-trigger.active {
    border-color: var(--brand-primary, #059669);
    background: var(--bg-surface, #f8fafc);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15); /* Focus ring */
}

/* Images & Icons */
.lang-trigger img {
    width: 20px;
    height: 15px; /* Fixed height to prevent layout shifts */
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 0 1px rgba(0,0,0,0.2);
}

.lang-trigger i {
    font-size: 0.75rem;
    color: var(--text-subtle, #64748b);
    transition: transform 0.3s ease;
}

/* Rotate arrow when active */
.lang-trigger.active i {
    transform: rotate(180deg);
    color: var(--brand-primary, #059669);
}

/* Dropdown Menu - HIDDEN BY DEFAULT */
.lang-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 160px;
    background: #ffffff;
    border: 1px solid var(--border-medium, #e2e8f0);
    border-radius: 12px;
    
    display: none; /* CRITICAL FIX: Ensures menu is hidden initially */
    flex-direction: column;
    padding: 6px;
    
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 10px 15px -3px rgba(0, 0, 0, 0.1);
        
    transform-origin: top right;
}

/* Show when active class is added by JS */
.lang-menu.active {
    display: flex;
    animation: menuScaleIn 0.2s ease-out forwards;
}

/* Menu Options */
.lang-option {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-main, #334155);
    transition: background 0.15s ease, color 0.15s ease;
}

.lang-option img {
    width: 20px;
    height: 15px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 0 1px rgba(0,0,0,0.2);
}

.lang-option:hover {
    background-color: var(--bg-surface, #f8fafc);
    color: var(--brand-primary, #059669);
}

.lang-option.selected {
    background-color: rgba(5, 150, 105, 0.08);
    color: var(--brand-primary, #059669);
    font-weight: 600;
}

@keyframes menuScaleIn {
    0% { opacity: 0; transform: scale(0.95) translateY(-10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* =========================================
   3. RESPONSIVE MOBILE STYLES
   ========================================= */
@media (max-width: 768px) {
    .global-nav { 
        padding: 0 16px; 
    }
    
    /* Hide logo if screen is too small */
    .global-nav-logo { 
        display: none; 
    } 
    
    /* Hide "Back to App" text, keep only the arrow icon */
    .global-back-btn span { 
        display: none; 
    }
    
    /* Adjust main content padding to account for fixed header */
    .privacy-wrapper, .doc-container { 
        padding-top: 80px; 
        padding-left: 16px; 
        padding-right: 16px; 
    }
    
    .privacy-card { 
        padding: 2rem; 
        box-shadow: none; 
    }
    
    h1 { 
        font-size: 1.75rem; 
    }
}