/* ========================================
   AQUARIWA POLSKA - Style przełącznika języka
   ======================================== */

.language-switcher {
    position: relative;
    display: inline-block;
    margin-right: 1rem;
    z-index: 1001;
}

.language-current {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    backdrop-filter: blur(10px);
}

.language-current:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.language-current .flag {
    font-size: 1.2rem;
    line-height: 1;
}

.language-current .lang-name {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}

.language-current .arrow {
    color: var(--primary-color);
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.language-dropdown.active .language-current .arrow {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid rgba(27, 38, 59, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(27, 38, 59, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
    backdrop-filter: blur(10px);
    margin-top: 4px;
}

.language-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(27, 38, 59, 0.05);
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: rgba(27, 38, 59, 0.05);
}

.language-option.active {
    background: rgba(192, 57, 43, 0.1);
    color: var(--accent-color);
}

.language-option .flag {
    font-size: 1.1rem;
    line-height: 1;
}

.language-option .lang-name {
    color: var(--text-dark);
    font-weight: 400;
    font-size: 0.9rem;
}

.language-option.active .lang-name {
    color: var(--accent-color);
    font-weight: 500;
}

/* Animacja pojawiania się */
@keyframes languageDropdownIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.language-dropdown.active {
    animation: languageDropdownIn 0.3s ease-out;
}

/* Responsywność */
@media (max-width: 768px) {
    .language-switcher {
        margin-right: 0.5rem;
    }
    
    .language-current {
        padding: 6px 10px;
        min-width: 100px;
    }
    
    .language-current .lang-name {
        font-size: 0.8rem;
    }
    
    .language-current .flag {
        font-size: 1rem;
    }
    
    .language-option {
        padding: 8px 10px;
    }
    
    .language-option .lang-name {
        font-size: 0.8rem;
    }
    
    .language-option .flag {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .language-current .lang-name {
        display: none;
    }
    
    .language-current {
        min-width: auto;
        padding: 6px 8px;
    }
    
    .language-dropdown {
        right: auto;
        left: -50px;
        min-width: 150px;
    }
}

/* Integracja z istniejącą nawigacją */
.nav__actions .language-switcher {
    display: flex;
    align-items: center;
}

/* Styl dla header w trybie przewijania */
.header.scrolled .language-current {
    background: rgba(27, 38, 59, 0.05);
    border-color: rgba(27, 38, 59, 0.1);
}

.header.scrolled .language-current:hover {
    background: rgba(27, 38, 59, 0.1);
}

/* Hover efekty */
.language-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--accent-color);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.language-option:hover::before,
.language-option.active::before {
    transform: scaleY(1);
}

/* Fokus dla dostępności */
.language-current:focus,
.language-option:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Animacja flag */
.language-option .flag {
    transition: transform 0.2s ease;
}

.language-option:hover .flag {
    transform: scale(1.1);
}

/* Gradient hover dla opcji */
.language-option:hover {
    background: linear-gradient(90deg, 
        rgba(192, 57, 43, 0.05) 0%, 
        rgba(192, 57, 43, 0.02) 100%);
}

/* Cień dla dropdown */
.language-dropdown {
    box-shadow: 
        0 4px 20px rgba(27, 38, 59, 0.1),
        0 2px 8px rgba(27, 38, 59, 0.08),
        0 1px 3px rgba(27, 38, 59, 0.06);
}

/* Smooth scrolling dla długiej listy języków */
.language-dropdown {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(27, 38, 59, 0.2) transparent;
}

.language-dropdown::-webkit-scrollbar {
    width: 4px;
}

.language-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.language-dropdown::-webkit-scrollbar-thumb {
    background: rgba(27, 38, 59, 0.2);
    border-radius: 2px;
}

.language-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(27, 38, 59, 0.3);
}

/* Efekt loading podczas zmiany języka */
.language-switcher.loading .language-current {
    opacity: 0.7;
    pointer-events: none;
}

.language-switcher.loading .language-current::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 8px;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translateY(-50%);
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Dark mode support (jeśli będzie potrzebny) */
@media (prefers-color-scheme: dark) {
    .language-dropdown {
        background: rgba(27, 38, 59, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .language-option .lang-name {
        color: rgba(255, 255, 255, 0.9);
    }
    
    .language-option:hover {
        background: rgba(255, 255, 255, 0.05);
    }
} 