﻿/* Quality, Speed, and Download Panels - Shared canonical layer */

:where(.mp-quality-panel, .mp-speed-panel, .mp-download-panel) {
    position: absolute;
    bottom: 3rem;
    left: var(--mp-flyout-panel-left);
    right: var(--mp-flyout-panel-right);
    width: var(--mp-flyout-panel-width);
    max-width: var(--mp-flyout-panel-max-width);
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(11, 12, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    color: #fff;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transform: translateX(var(--mp-flyout-panel-x)) translateY(8px) scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

:where(.mp-quality-panel, .mp-speed-panel, .mp-download-panel).is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(var(--mp-flyout-panel-x)) translateY(0) scale(1);
}

:where(.mp-quality-panel-header, .mp-speed-panel-header, .mp-download-header) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

:where(.mp-quality-panel-title, .mp-speed-panel-title, .mp-download-title) {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}

:where(.mp-quality-close, .mp-speed-close, .mp-download-close) {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    background: rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
}

:where(.mp-quality-close, .mp-speed-close, .mp-download-close):hover {
    background: rgba(255, 255, 255, 0.1);
}

:where(.mp-quality-list, .mp-download-list) {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

:where(.mp-quality-item, .mp-download-item) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

:where(.mp-quality-item, .mp-download-item):hover {
    background: rgba(255, 255, 255, 0.1);
}

:where(.mp-quality-toggle, .mp-speed-toggle, .mp-download-toggle) {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

:where(.mp-quality-toggle, .mp-speed-toggle, .mp-download-toggle):hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

:where(.mp-quality-toggle, .mp-speed-toggle, .mp-download-toggle).is-active {
    background: rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* Quality panel */
.mp-quality-item.is-active {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.mp-quality-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.mp-quality-badge {
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    background: rgba(59, 130, 246, 0.2);
    font-size: 0.625rem;
    font-weight: 600;
    color: #60a5fa;
}

.mp-quality-check {
    width: 1rem;
    height: 1rem;
    color: #60a5fa;
    opacity: 0;
}

.mp-quality-item.is-active .mp-quality-check {
    opacity: 1;
}

/* Speed panel */
.mp-speed-presets-grid {
    display: grid;
    grid-template-columns: repeat(var(--mp-speed-presets-cols), minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mp-speed-preset-btn {
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.mp-speed-preset-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mp-speed-preset-btn.is-active {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.mp-speed-custom {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
}

.mp-speed-custom-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.mp-speed-value {
    font-weight: 600;
    color: #60a5fa;
}

.mp-speed-slider {
    width: 100%;
    height: 0.25rem;
    border-radius: 9999px;
    appearance: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
}

.mp-speed-slider::-webkit-slider-thumb {
    appearance: none;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    cursor: pointer;
    background: #60a5fa;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}

.mp-speed-slider::-moz-range-thumb {
    width: 1rem;
    height: 1rem;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    background: #60a5fa;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}
