/* Header Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background-color: #ffffff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header Navigation */
header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
}

.logo-img {
    height: 70px;
    width: auto;
    display: block;
    margin: 8px 0;
    transition: transform 0.3s ease;
}

.logo:hover .logo-img {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease, border-bottom 0.3s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: #2D5F7C;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #2D5F7C;
}

.cta-button {
    background: #2D5F7C;
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(45, 95, 124, 0.3);
}

.cta-button:hover {
    background: #1e4a5f;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 95, 124, 0.4);
}

/* Language Selector */
.lang-search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.language-selector {
    display: flex;
    align-items: center;
}

.desktop-lang-selector {
    display: block;
}

.mobile-lang-dropdown {
    display: none;
}

.lang-dropdown {
    min-width: 80px;
    height: 40px;
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-dropdown:hover {
    border-color: #2D5F7C;
}

.lang-dropdown:focus {
    outline: none;
    border-color: #2D5F7C;
    box-shadow: 0 0 0 3px rgba(45, 95, 124, 0.1);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mobile Language Dropdown */
.custom-lang-dropdown {
    position: relative;
}

.lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-width: 80px;
    justify-content: space-between;
}

.lang-dropdown-btn:hover,
.lang-dropdown-btn:focus {
    border-color: #2D5F7C;
    outline: none;
}

.current-lang {
    font-weight: 500;
    color: #1a202c;
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.lang-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

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

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #4a5568;
    transition: background-color 0.2s ease;
}

.lang-option:hover,
.lang-option.active {
    background-color: #f7fafc;
    color: #2D5F7C;
}

.lang-flag {
    font-size: 1rem;
}

.lang-code {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Search Container */
.search-container {
    position: relative;
    margin: 0 0 0.75rem 0;
    padding: 0;
}

.search-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

.search-input {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 0.9rem;
    width: 200px;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #2D5F7C;
    box-shadow: 0 0 0 3px rgba(45, 95, 124, 0.1);
    width: 250px;
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.search-btn:hover {
    background-color: #f7fafc;
}

.search-icon {
    font-size: 0.9rem;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.search-results.show {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Search Results Styling */
.search-category-group {
    border-bottom: 1px solid #e2e8f0;
}

.search-category-group:last-child {
    border-bottom: none;
}

.category-header {
    padding: 0.75rem 1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.category-results {
    padding: 0.25rem 0;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-left: 3px solid transparent;
}

.search-result-item:hover,
.search-result-item.selected {
    background-color: #f1f5f9;
    border-left-color: #2D5F7C;
}

.search-result-item:focus {
    outline: 2px solid #2D5F7C;
    outline-offset: -2px;
}

.result-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.result-title mark {
    background-color: #fef3c7;
    color: #92400e;
    padding: 0 0.125rem;
    border-radius: 2px;
}

.result-description {
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.4;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-description mark {
    background-color: #fef3c7;
    color: #92400e;
    font-weight: 500;
}

.search-no-results {
    padding: 2rem 1rem;
    text-align: center;
    color: #64748b;
}

.no-results-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.no-results-text {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #475569;
}

.no-results-hint {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .desktop-lang-selector {
        display: none;
    }
    
    .mobile-lang-dropdown {
        display: block;
    }
    
    .search-input {
        width: 150px;
    }
    
    .search-input:focus {
        width: 180px;
    }
    
    .nav-links a {
        font-size: 0.85rem;
    }
    
    .cta-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .logo-img {
        height: 50px;
    }
    
    nav {
        padding: 1rem 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .nav-links {
        gap: 0.5rem;
    }
    
    .lang-search-container {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .search-container {
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
    
    .search-input:focus {
        width: 100%;
    }
    
    .cta-button {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    nav {
        position: relative;
        flex-wrap: nowrap;
        align-items: center;
    }

    .mobile-menu-toggle {
        display: flex;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        margin-left: auto;
        width: 60px;
        height: 60px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 6px;
        z-index: 1100;
        position: relative;
        border-radius: 8px;
        transition: background-color 0.2s ease;
        min-width: 44px;
        min-height: 44px;
        flex-shrink: 0;
    }

    .mobile-menu-toggle:hover {
        background-color: rgba(23, 42, 57, 0.1);
    }

    .mobile-menu-toggle:active {
        background-color: rgba(23, 42, 57, 0.2);
        transform: scale(0.95);
    }

    /* Debug: Visual indicator for clickable area */
    .mobile-menu-toggle::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border: 1px dashed rgba(255, 0, 0, 0.3);
        border-radius: 8px;
        pointer-events: none;
        z-index: 1;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 22px;
        height: 3px;
        background: #1a202c;
        transition: transform 0.3s ease, opacity 0.3s ease;
        border-radius: 2px;
        position: static;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: -1.5rem;
        right: -1.5rem;
        background: rgba(255, 255, 255, 0.97);
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 3rem 2rem;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        z-index: 1050;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin: 0;
    }

    .nav-links a {
        padding: 1.25rem 2rem;
        font-size: 1rem;
        border-radius: 12px;
        transition: background-color 0.2s ease;
        min-width: auto;
        width: 100%;
        text-align: left;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .nav-links a:hover {
        background-color: rgba(23, 42, 57, 0.05);
    }

    .nav-links a.active::after {
        bottom: 8px;
    }

    .nav-links .cta-button {
        width: 100%;
        text-align: center;
    }

    .lang-search-container {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .search-container {
        width: 100%;
    }

    .search-input {
        width: 100%;
    }

    .search-input:focus {
        width: 100%;
    }

    .cta-button {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* RTL Support */
[dir="rtl"] .nav-links {
    flex-direction: row-reverse;
}

[dir="rtl"] .lang-search-container {
    flex-direction: column;
}

[dir="rtl"] .search-wrapper {
    flex-direction: row-reverse;
}

[dir="rtl"] .search-input {
    padding: 0.75rem 1rem 0.75rem 2.5rem;
}

[dir="rtl"] .search-btn {
    right: auto;
    left: 0.5rem;
}

[dir="rtl"] .lang-dropdown-menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .dropdown-arrow {
    transform: rotate(180deg);
}
