/* LANGUAGE SWITCHER STYLES */

/* Language Switcher Container */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    padding: 4px;
    backdrop-filter: blur(10px);
}

/* Language Button */
.lang-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 100px;
    color: #888;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    outline: none;
}

.lang-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.lang-btn.active {
    background: #4A9EFF;
    color: #fff;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

/* Language Flag */
.lang-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.lang-flag svg {
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.lang-btn:hover .lang-flag,
.lang-btn.active .lang-flag {
    filter: grayscale(0%);
}

/* Language Code */
.lang-code {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Animations */
@keyframes langSwitch {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

.lang-btn.active {
    animation: langSwitch 0.3s ease;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .language-switcher {
        /* Keep in header instead of fixed bottom */
        position: relative;
        bottom: auto;
        right: auto;
        padding: 2px;
        gap: 2px;
    }

    .lang-btn {
        padding: 6px 10px;
        gap: 4px;
        font-size: 0.75rem;
    }

    /* Hide language code on very small screens to save space */
    @media (max-width: 375px) {
        .lang-code {
            display: none;
        }

        .lang-btn {
            padding: 6px;
        }
    }
}

/* Integration with existing nav */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Premium page specific */
.nav-premium .language-switcher {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

/* Projects page specific */
.nav-projects .language-switcher {
    background: rgba(0, 0, 0, 0.3);
}

/* Tooltip for language name */
.lang-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    font-size: 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

.lang-btn[data-lang="tr"]::after {
    content: "Türkçe";
}

.lang-btn[data-lang="en"]::after {
    content: "English";
}

.lang-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Dark/Light theme compatibility */
body.light-theme .language-switcher {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .lang-btn {
    color: #666;
}

body.light-theme .lang-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #000;
}

body.light-theme .lang-btn.active {
    background: #4A9EFF;
    color: #fff;
}

/* Smooth transition for content changes */
[data-translate] {
    transition: opacity 0.2s ease;
}

.language-changing [data-translate] {
    opacity: 0.7;
}

/* Language indicator in footer */
.language-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    font-size: 0.75rem;
    color: #888;
    margin-left: auto;
}

.language-indicator::before {
    content: "🌐";
    font-size: 1rem;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    .lang-btn,
    .language-switcher,
    [data-translate] {
        transition: none;
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .language-switcher {
        border-width: 2px;
    }

    .lang-btn.active {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }
}