/* Language Selector Styles - Arctevon Original Style */
#languageSelectorContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

#languageToggleBtn {
    background: 
        linear-gradient(135deg, 
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

#languageToggleBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#languageToggleBtn:hover::before {
    opacity: 1;
}

#languageToggleBtn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

#languageToggleBtn:active {
    transform: translateY(0) scale(1.02);
    transition: all 0.1s ease;
}

#languageToggleBtn .icon {
    position: relative;
    z-index: 1;
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.3));
}

#languageSelector {
    display: flex;
    flex-direction: column; /* Default: vertical */
    gap: 12px;
    background: linear-gradient(145deg, rgba(12, 34, 59, 0.97), rgba(6, 21, 40, 0.97));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(91, 210, 255, 0.3);
    border-radius: 16px;
    padding: 16px;
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    
    /* Default position (upwards) */
    bottom: 70px;
    right: 0;
    transform-origin: bottom right;
    transform: scale(0.9) translateY(10px);
}

#languageSelector.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

/* Media Query for smaller/shorter screens (tablets, phones) */
@media (max-width: 768px), (max-height: 450px) {
    #languageSelector {
        flex-direction: row; /* Horizontal layout */
        
        /* New position (sideways) */
        bottom: 0;
        right: 70px;
        transform-origin: bottom right;
        transform: scale(0.9) translateX(10px);
    }

    #languageSelector.show {
        transform: scale(1) translateX(0);
    }
}

.lang-btn {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    min-width: 48px;
    min-height: 42px;
    padding: 8px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.lang-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%);
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lang-btn:hover::before {
    opacity: 1;
}

.lang-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.lang-btn:active {
    transform: scale(1.05) translateY(0);
    transition: all 0.1s ease;
}

.lang-btn span {
    position: relative;
    z-index: 1;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Arctevon flag button treatment */
.lang-btn {
    gap: 9px;
    min-width: 82px;
}

.lang-btn .flag-icon {
    position: relative;
    z-index: 1;
    width: 30px;
    height: 20px;
    flex: 0 0 auto;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.lang-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(91, 210, 255, 0.42);
    background: rgba(27, 133, 190, 0.2);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.28);
}

@media (max-width: 480px) {
    .lang-btn {
        min-width: 48px;
        padding: 8px;
    }

    .lang-btn span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }
}

/* Compact abbreviation selector */
#languageToggleBtn {
    width: 54px;
    min-width: 54px;
    height: 54px;
    padding: 0;
    gap: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(13, 48, 78, 0.94), rgba(7, 27, 50, 0.94));
    border-color: rgba(78, 214, 255, 0.34);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3), inset 0 1px rgba(255, 255, 255, 0.12);
}

#languageToggleBtn::before {
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 153, 255, 0.18), rgba(36, 224, 195, 0.12));
}

#languageToggleBtn .icon {
    width: 21px;
    height: 21px;
    color: #77ddff;
}

#currentLanguageCode {
    position: relative;
    z-index: 1;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.1em;
}

#languageSelector {
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
}

@media (max-width: 480px) {
    .lang-btn {
        min-width: 54px;
        min-height: 42px;
        padding: 9px 12px;
    }

    .lang-btn span {
        position: relative;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
    }
}

.lang-btn {
    min-width: 54px;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 10px;
}

.lang-btn span {
    font-size: 13px;
    letter-spacing: 0.1em;
}
