/**
 * QwenTranslate Language Switcher Styles
 *
 * @package QwenTranslate
 */

/* ==========================================
   Language Switcher - Floating Widget
   ========================================== */

.qt-switcher {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

/* 位置变体 */
.qt-switcher-bottom-right {
    bottom: 24px;
    right: 24px;
}

.qt-switcher-bottom-left {
    bottom: 24px;
    left: 24px;
}

.qt-switcher-top-right {
    top: 24px;
    right: 24px;
}

.qt-switcher-top-left {
    top: 24px;
    left: 24px;
}

/* ==========================================
   Toggle Button
   ========================================== */

.qt-switcher-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #1C1714;
    color: #E8DCC8;
    border: 1px solid #C9A962;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.25s ease;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.qt-switcher-toggle:hover {
    background: #2A2118;
    border-color: #D4B96E;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.qt-switcher-toggle:focus {
    outline: 2px solid #C9A962;
    outline-offset: 2px;
}

.qt-switcher-flag {
    font-size: 18px;
    line-height: 1;
}

.qt-switcher-label {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qt-switcher-arrow {
    font-size: 10px;
    transition: transform 0.25s ease;
    opacity: 0.7;
}

.qt-switcher.open .qt-switcher-arrow {
    transform: rotate(180deg);
}

/* ==========================================
   Dropdown Menu
   ========================================== */

.qt-switcher-dropdown {
    display: none;
    position: absolute;
    list-style: none;
    margin: 0;
    padding: 6px 0;
    background: #1C1714;
    border: 1px solid #C9A962;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    min-width: 180px;
    max-height: 320px;
    overflow-y: auto;
}

/* 下方展开（bottom-*） */
.qt-switcher-bottom-right .qt-switcher-dropdown,
.qt-switcher-bottom-left .qt-switcher-dropdown {
    bottom: 100%;
    margin-bottom: 8px;
}

.qt-switcher-bottom-right .qt-switcher-dropdown {
    right: 0;
}

.qt-switcher-bottom-left .qt-switcher-dropdown {
    left: 0;
}

/* 上方展开（top-*） */
.qt-switcher-top-right .qt-switcher-dropdown,
.qt-switcher-top-left .qt-switcher-dropdown {
    top: 100%;
    margin-top: 8px;
}

.qt-switcher-top-right .qt-switcher-dropdown {
    right: 0;
}

.qt-switcher-top-left .qt-switcher-dropdown {
    left: 0;
}

/* 打开状态 */
.qt-switcher.open .qt-switcher-dropdown {
    display: block;
    animation: qtSwitcherFadeIn 0.2s ease;
}

@keyframes qtSwitcherFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   Dropdown Items
   ========================================== */

.qt-switcher-item {
    margin: 0;
    padding: 0;
}

.qt-switcher-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #E8DCC8;
    text-decoration: none;
    transition: background 0.15s ease;
}

.qt-switcher-item a:hover {
    background: rgba(201, 169, 98, 0.15);
}

.qt-switcher-item.qt-switcher-active a {
    background: rgba(201, 169, 98, 0.1);
    color: #C9A962;
    font-weight: 600;
}

.qt-switcher-item.qt-switcher-active a::after {
    content: '✓';
    margin-left: auto;
    font-size: 12px;
    opacity: 0.8;
}

.qt-switcher-name {
    flex: 1;
}

/* ==========================================
   Scrollbar
   ========================================== */

.qt-switcher-dropdown::-webkit-scrollbar {
    width: 6px;
}

.qt-switcher-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.qt-switcher-dropdown::-webkit-scrollbar-thumb {
    background: rgba(201, 169, 98, 0.3);
    border-radius: 3px;
}

.qt-switcher-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 169, 98, 0.5);
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 480px) {
    .qt-switcher {
        bottom: 12px !important;
        right: 12px !important;
        left: auto !important;
        top: auto !important;
    }

    .qt-switcher-toggle {
        padding: 8px 12px;
        font-size: 13px;
    }

    .qt-switcher-label {
        display: none;
    }

    .qt-switcher-dropdown {
        right: 0;
        left: auto;
        min-width: 160px;
    }
}
