/* Language Switcher Styles */
.language-switcher {
    display: flex;
    align-items: center;
    margin: 0 20px;
}

.lang-select {
    padding: 8px 12px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    background: white;
    color: #1E293B;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    min-width: 100px;
}

.lang-select:hover {
    border-color: #0EA5E9;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

.lang-select:focus {
    border-color: #0EA5E9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Mobile Language Switcher */
.mobile-language-switcher {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px;
    z-index: 1000;
}

.lang-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #64748B;
    font-weight: 600;
    font-size: 14px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 4px;
}

.lang-btn:hover {
    background: #F1F5F9;
    color: #1E293B;
}

.lang-btn.active {
    background: linear-gradient(135deg, #0EA5E9 0%, #7C3AED 100%);
    color: white;
}

/* Hindi Font Support */
html[lang="hi"] body {
    font-family: 'Noto Sans Devanagari', 'Inter', sans-serif;
}

html[lang="hi"] .hero-title,
html[lang="hi"] h1,
html[lang="hi"] h2,
html[lang="hi"] h3,
html[lang="hi"] h4 {
    font-family: 'Noto Sans Devanagari', 'Inter', sans-serif;
    line-height: 1.4;
}

/* Adjust spacing for Devanagari script */
html[lang="hi"] p,
html[lang="hi"] .feature-list li,
html[lang="hi"] .summary-item {
    line-height: 1.8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .language-switcher {
        display: none;
    }
    
    .mobile-language-switcher {
        display: flex;
    }
    
    .nav-menu.active .language-switcher {
        display: block;
        margin: 20px 0;
    }
    
    .nav-menu.active .lang-select {
        width: 100%;
    }
}

/* Language-specific text adjustments */
html[lang="hi"] .btn-primary,
html[lang="hi"] .btn-secondary {
    font-size: 15px;
    padding: 14px 28px;
}

html[lang="hinglish"] .gradient-text {
    font-style: italic;
}

/* Chart label adjustments for Hindi */
html[lang="hi"] canvas {
    font-family: 'Noto Sans Devanagari', sans-serif !important;
}

/* Animation for language switch */
.language-transition {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tooltip for language names */
.lang-select option {
    padding: 8px;
}

.lang-select option[value="hi"] {
    font-family: 'Noto Sans Devanagari', sans-serif;
}

/* Language indicator flag (optional) */
.language-switcher::before {
    content: '🌐';
    margin-right: 8px;
    font-size: 18px;
}

/* Smooth text transition */
* {
    transition: font-family 0.3s ease;
}

/* Ensure proper rendering of Hindi numerals */
html[lang="hi"] .chart-container {
    font-feature-settings: "locl";
}

/* Fix alignment issues with mixed scripts */
.nav-menu a {
    display: inline-flex;
    align-items: center;
}

/* Language switcher in footer for better accessibility */
.footer-language {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-language .lang-select {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.footer-language .lang-select:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Accessibility improvements */
.lang-select:focus-visible,
.lang-btn:focus-visible {
    outline: 2px solid #0EA5E9;
    outline-offset: 2px;
}

/* Loading state for translations */
.loading-translations {
    opacity: 0.5;
    pointer-events: none;
}

.loading-translations::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}