/**
 * ITDominion Bilingual - Language Switcher Styles
 * iOS 16+ Ultra-transparent glassmorphism
 */

.itdb-language-switcher {
    position: fixed;
    top: 15%;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

.itdb-lang-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
}

.itdb-lang-list .lang-item {
    margin: 0;
    padding: 0;
    position: relative;
}

.itdb-lang-list .lang-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    position: relative;
    
    /* iOS 16+ Ultra-transparent glassmorphism */
    background: rgba(255, 255, 255, 0.15);  /* Much more transparent */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 
        0 8px 32px rgba(31, 38, 135, 0.15),
        0 0 0 0.5px rgba(255, 255, 255, 0.18) inset,
        0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.itdb-lang-list .lang-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.15);
    box-shadow: 
        0 12px 40px rgba(46, 163, 242, 0.25),
        0 0 0 0.5px rgba(255, 255, 255, 0.3) inset,
        0 0 0 1px rgba(46, 163, 242, 0.2);
}

.itdb-lang-list .current-lang .lang-link {
    /* Active state with more vibrant but still transparent gradient */
    background: linear-gradient(
        135deg, 
        rgba(46, 163, 242, 0.5) 0%, 
        rgba(29, 141, 214, 0.5) 100%
    );
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    box-shadow: 
        0 12px 40px rgba(46, 163, 242, 0.35),
        0 0 0 0.5px rgba(255, 255, 255, 0.4) inset,
        0 0 0 1px rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.itdb-lang-list .current-lang .lang-link:hover {
    background: linear-gradient(
        135deg, 
        rgba(46, 163, 242, 0.6) 0%, 
        rgba(29, 141, 214, 0.6) 100%
    );
    transform: scale(1.1);
}

/* Flag emoji styling - centered in circle */
.lang-flag {
    font-size: 26px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Hide language code and name - flags only */
.lang-code,
.lang-name {
    display: none;
}

/* Subtle glow indicator dot for current language */
.itdb-lang-list .current-lang .lang-link::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: rgba(46, 163, 242, 0.9);
    border-radius: 50%;
    box-shadow: 
        0 0 0 2px rgba(255, 255, 255, 0.5),
        0 0 8px rgba(46, 163, 242, 0.6);
}

/* Mobile responsive */
@media (max-width: 767px) {
    .itdb-language-switcher {
        top: auto;
        bottom: 20px;
        right: 15px;
    }
    
    .itdb-lang-list {
        gap: 10px;
    }
    
    .itdb-lang-list .lang-link {
        width: 46px;
        height: 46px;
    }
    
    .lang-flag {
        font-size: 24px;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    .itdb-language-switcher {
        right: 15px;
    }
}

/* Smooth entrance animation */
.itdb-language-switcher {
    animation: fadeInSlide 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Individual circle entrance with stagger effect */
.itdb-lang-list .lang-item:nth-child(1) {
    animation: bounceIn 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.1s backwards;
}

.itdb-lang-list .lang-item:nth-child(2) {
    animation: bounceIn 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.25s backwards;
}

@keyframes bounceIn {
    from {
        opacity: 0;
        transform: scale(0.3) rotate(180deg);
    }
    50% {
        transform: scale(1.1) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

/* Accessibility improvements */
.itdb-lang-list .lang-link:focus {
    outline: 2px solid rgba(46, 163, 242, 0.6);
    outline-offset: 4px;
    background: rgba(255, 255, 255, 0.3);
}

.itdb-lang-list .current-lang .lang-link:focus {
    outline-color: rgba(46, 163, 242, 0.8);
}

/* Enhanced fallback for browsers without backdrop-filter */
@supports not ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
    .itdb-lang-list .lang-link {
        background: rgba(255, 255, 255, 0.85);
    }
    
    .itdb-lang-list .current-lang .lang-link {
        background: linear-gradient(
            135deg, 
            rgba(46, 163, 242, 0.85) 0%, 
            rgba(29, 141, 214, 0.85) 100%
        );
    }
}

/* Subtle breathing animation for current language */
.itdb-lang-list .current-lang .lang-link {
    animation: subtleBreath 3s ease-in-out infinite;
}

@keyframes subtleBreath {
    0%, 100% {
        transform: scale(1.05);
        box-shadow: 
            0 12px 40px rgba(46, 163, 242, 0.35),
            0 0 0 0.5px rgba(255, 255, 255, 0.4) inset,
            0 0 0 1px rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 
            0 16px 48px rgba(46, 163, 242, 0.45),
            0 0 0 0.5px rgba(255, 255, 255, 0.5) inset,
            0 0 0 1px rgba(255, 255, 255, 0.3);
    }
}

/* Hover interrupts breathing animation */
.itdb-lang-list .current-lang .lang-link:hover {
    animation: none;
}
