/**
 * 西瓜播放器设置菜单样式
 */

/* 设置按钮样式 - 与原生按钮保持一致 */
.xgplayer-settings {
    position: relative;
}

/* 设置菜单容器 */
.xgplayer-settings-menu {
    position: absolute;
    bottom: 50px;
    right: -120px;
    z-index: 999999;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.xgplayer-settings-menu.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* 设置菜单内容 */
.settings-menu-content {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 280px;
    max-width: 320px;
    overflow: hidden;
}

/* 设置菜单头部 */
.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.settings-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.settings-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* 设置菜单主体 */
.settings-body {
    padding: 20px;
}

/* 设置项 */
.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-item:first-child {
    padding-top: 0;
}

/* 设置信息 */
.setting-info {
    flex: 1;
    margin-right: 16px;
}

.setting-label {
    display: block;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.setting-desc {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    line-height: 1.4;
}

/* 切换开关 */
.setting-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.setting-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.setting-toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, #00d4aa 0%, #00a6ff 100%);
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.2);
}

.setting-toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.setting-toggle:hover .toggle-slider {
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.1);
}

.setting-toggle input:checked:hover + .toggle-slider {
    box-shadow: 0 0 0 8px rgba(0, 212, 170, 0.1);
}

/* 响应式适配 */
@media (max-width: 768px) {
    .xgplayer-settings-menu {
        right: -100px;
        bottom: 45px;
    }
    
    .settings-menu-content {
        min-width: 260px;
        max-width: calc(100vw - 20px);
    }
    
    .settings-header {
        padding: 14px 16px;
    }
    
    .settings-body {
        padding: 16px;
    }
    
    .setting-item {
        padding: 14px 0;
    }
}

/* 深色主题兼容 */
@media (prefers-color-scheme: dark) {
    .settings-menu-content {
        background: rgba(20, 20, 20, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }
    
    .settings-header {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }
    
    .setting-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
}

/* 播放器全屏状态下的菜单位置调整 */
.xgplayer.xgplayer-is-fullscreen .xgplayer-settings-menu {
    position: fixed;
    bottom: 80px;
    right: -120px;
}

/* 移动端全屏状态 */
.xgplayer.xgplayer-mobile-fullscreen .xgplayer-settings-menu {
    bottom: 60px;
    right: -100px;
}

/* 简化动画效果 */
@keyframes settingsMenuSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.xgplayer-settings-menu.show {
    animation: settingsMenuSlideIn 0.2s ease-out forwards;
}

/* 线路选择器样式 */
.setting-control {
    flex-shrink: 0;
}

.source-line-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.source-line-status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.source-line-status .status-text {
    animation: sourceLineSwitching 1.5s infinite;
}

.source-line-status .status-reset {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.source-line-status .status-reset:hover {
    background: rgba(255, 100, 100, 0.8);
    border-color: rgba(255, 100, 100, 1);
    color: white;
    transform: scale(1.1);
}

@keyframes sourceLineSwitching {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.source-line-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    min-width: 100px;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23ffffff" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 32px;
}

.source-line-select:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.source-line-select:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(0, 212, 170, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.2);
}

.source-line-select:disabled {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.source-line-select option {
    background: #2a2a2a;
    color: #fff;
    padding: 8px 12px;
}

/* 线路状态指示器 */
.source-line-select::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4aa 0%, #00a6ff 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.source-line-select:focus::before {
    opacity: 1;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .source-line-select {
        font-size: 14px;
        padding: 10px 14px;
        padding-right: 36px;
        min-width: 120px;
    }
}

/* 深色主题兼容 */
@media (prefers-color-scheme: dark) {
    .source-line-select {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .source-line-select:hover {
        background-color: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .source-line-select option {
        background: #1a1a1a;
    }
}