/* Stealth Browse - Video Downloader Power Up */

.video-downloader-toggle-container:not([hidden]):not(.appearance-hidden) {
    display: flex !important;
    align-items: center;
    flex-shrink: 0;
    margin: 0;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
}

#video-downloader-toggle-container[hidden],
#video-downloader-toggle-container.appearance-hidden,
.top-bar #video-downloader-toggle-container[hidden],
.top-bar #video-downloader-toggle-container.appearance-hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#video-downloader-toggle-btn img,
.top-bar #video-downloader-toggle-btn img {
    width: 11px !important;
    height: 11px !important;
    max-width: 11px !important;
    max-height: 11px !important;
    display: block !important;
    object-fit: contain !important;
    filter: brightness(0) saturate(100%) invert(68%) sepia(48%) saturate(1200%) hue-rotate(196deg) brightness(1.05);
}

#video-downloader-toggle-btn.is-open {
    color: #93c5fd;
    border-color: rgba(96, 165, 250, 0.55);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.22), rgba(90, 13, 214, 0.28));
}

.video-downloader-window {
    --panel-fill-alpha: 0.28;
    --frost-tint-alpha: 0.18;
    position: fixed;
    top: 104px;
    right: 72px;
    width: 380px;
    height: auto;
    min-width: 320px;
    max-height: 720px;
    z-index: 2147483647 !important;
    border-radius: 16px;
    overflow: hidden !important;
    background: rgba(22, 22, 30, var(--panel-fill-alpha, 0.28)) !important;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
    display: none;
    flex-direction: column;
    color: #f2f2f6;
    font-family: inherit;
    pointer-events: auto;
    clip-path: inset(0 round 16px);
    -webkit-clip-path: inset(0 round 16px);
    backdrop-filter: blur(28px) saturate(1.15);
    -webkit-backdrop-filter: blur(28px) saturate(1.15);
}

#video-downloader-window.show,
#video-downloader-window.page-frost-host {
    border-radius: 16px !important;
    overflow: hidden !important;
    clip-path: inset(0 round 16px) !important;
    -webkit-clip-path: inset(0 round 16px) !important;
}

.video-downloader-window.show { display: flex; }

.video-downloader-glass-sheen {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, transparent 42%),
        radial-gradient(ellipse at 20% 0%, rgba(90, 13, 214, 0.16), transparent 55%);
}

.video-downloader-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    min-height: 28px;
    cursor: grab;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.video-downloader-header-icon {
    width: 14px;
    height: 14px;
    display: block;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(72%) sepia(42%) saturate(650%) hue-rotate(220deg) brightness(1.05);
}

.video-downloader-header-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
}

.video-downloader-icon-btn {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--stealth-cut-sm, 8px 2px 2px 2px);
    background: rgba(255, 255, 255, 0.06);
    color: #e8e8ee;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.video-downloader-body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    overflow: auto;
    max-height: 560px;
}

.video-downloader-toolbar {
    display: flex;
    gap: 8px;
}

.video-downloader-btn {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--stealth-cut-sm, 8px 2px 2px 2px);
    background: rgba(255, 255, 255, 0.06);
    color: #f2f2f6;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
}

.video-downloader-btn.primary {
    border-color: rgba(90, 13, 214, 0.55);
    background: linear-gradient(135deg, #5a0dd6, #4900c2);
    color: #fff;
}

.video-downloader-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.62);
    min-height: 16px;
}

.video-downloader-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.55);
    margin: 4px 0;
}

.video-downloader-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.video-downloader-item {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--stealth-cut, 12px 2px 2px 2px);
    background: rgba(255, 255, 255, 0.04);
    padding: 10px;
    cursor: pointer;
}

.video-downloader-item.is-selected {
    border-color: rgba(90, 13, 214, 0.65);
    background: rgba(90, 13, 214, 0.14);
}

.video-downloader-item-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 4px;
}

.video-downloader-item-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.58);
}

.video-downloader-formats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.video-downloader-format {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--stealth-cut-sm, 8px 2px 2px 2px);
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 10px;
    cursor: pointer;
}

.video-downloader-format:hover {
    border-color: rgba(90, 13, 214, 0.45);
    background: rgba(90, 13, 214, 0.1);
}

.video-downloader-format-label {
    font-size: 12px;
    font-weight: 500;
}

.video-downloader-format-size {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
}

.video-downloader-empty {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.58);
    padding: 16px 8px;
    text-align: center;
}

.video-downloader-resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
    z-index: 3;
}

[data-theme="light"] .video-downloader-window {
    color: #18181b;
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(250, 250, 252, var(--panel-fill-alpha, 0.72)) !important;
}

[data-theme="light"] .video-downloader-item,
[data-theme="light"] .video-downloader-format,
[data-theme="light"] .video-downloader-btn {
    color: #18181b;
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.72);
}

[data-theme="light"] .video-downloader-status,
[data-theme="light"] .video-downloader-item-meta,
[data-theme="light"] .video-downloader-format-size,
[data-theme="light"] .video-downloader-empty,
[data-theme="light"] .video-downloader-section-title {
    color: rgba(24, 24, 27, 0.62);
}
