/* ===================================
   D-NOVA - Language Switcher
   Flagi w prawym górnym rogu
   =================================== */

.language-switcher {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    font-family: var(--font-primary, 'Inter', sans-serif);
}

.language-switcher-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.language-switcher-btn:hover {
    background: rgba(26, 26, 26, 0.9);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.15);
}

.language-switcher.open .language-switcher-btn {
    background: rgba(26, 26, 26, 0.95);
    border-color: rgba(0, 212, 255, 0.5);
}

.flag-emoji {
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.lang-code {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chevron {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.6;
}

.language-switcher.open .chevron {
    transform: rotate(180deg);
}

/* Dropdown */
.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.language-switcher.open .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.language-option:hover {
    background: rgba(0, 212, 255, 0.1);
}

.language-option.active {
    background: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
}

.language-option .flag-emoji {
    font-size: 20px;
}

.lang-name {
    flex: 1;
}

.checkmark {
    color: #00d4ff;
    font-size: 16px;
    font-weight: 700;
}

/* Animacja wejścia */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-switcher {
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsywność */
@media (max-width: 768px) {
    .language-switcher {
        top: 16px;
        right: 16px;
    }

    .language-switcher-btn {
        padding: 8px 12px;
        gap: 6px;
    }

    .flag-emoji {
        font-size: 16px;
    }

    .lang-code {
        font-size: 12px;
    }

    .language-dropdown {
        min-width: 180px;
    }

    .language-option {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Dostosowanie gdy navbar jest widoczny */
@media (min-width: 769px) {
    body:not(.has-hidden-navbar) .language-switcher {
        top: 80px;
    }
}

/* Dark theme enhancement */
[data-theme="dark"] .language-switcher-btn {
    background: rgba(10, 10, 10, 0.9);
}

[data-theme="dark"] .language-dropdown {
    background: rgba(10, 10, 10, 0.98);
}

/* Glow effect on hover */
.language-switcher-btn::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(0, 212, 255, 0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.language-switcher-btn:hover::before {
    opacity: 1;
}

/* Accessibility */
.language-option:focus,
.language-switcher-btn:focus {
    outline: 2px solid rgba(0, 212, 255, 0.5);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .language-switcher,
    .language-switcher-btn,
    .language-dropdown,
    .chevron {
        transition: none;
        animation: none;
    }
}
