/* ===== RESET & ROOT ===== */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}

:root {
    --bg:        #0b0c0e;
    --bg-panel:  rgba(14, 15, 18, 0.92);
    --bg-hover:  rgba(255, 255, 255, 0.03);
    --border:    rgba(255, 255, 255, 0.07);
    --border-hi: rgba(255, 82, 46, 0.5);

    --accent:    #ff522e;
    --primary:   #ff522e;
    --accent-2:  #ffb800;
    --accent-dim: rgba(255, 82, 46, 0.15);

    --text:      #e8e3dc;
    --text-muted:#6b6760;
    --text-dim:  #403d39;

    --success:   #39d98a;
    --warning:   #ffb800;
    --danger:    #ff3b30;

    --radius:    4px;
    --radius-lg: 10px;
    --font-mono: 'Space Mono', monospace;
    --font-sans: 'Syne', sans-serif;
}

body.light-theme {
    --bg:        #f2efe8;
    --bg-panel:  rgba(250, 248, 243, 0.95);
    --bg-hover:  rgba(0, 0, 0, 0.03);
    --border:    rgba(0, 0, 0, 0.08);
    --border-hi: rgba(255, 82, 46, 0.4);
    --text:      #1a1714;
    --text-muted:#8a8480;
    --text-dim:  #c0bdb8;
}

/* ===== BODY - FIXED SCROLL ===== */
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    overflow-y: auto;
    height: 100vh;
    width: 100vw;
    transition: background 0.4s, color 0.4s;
}

#three-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.35;
}

.noise-overlay {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
    opacity: 0.5;
    mix-blend-mode: overlay;
}

.scanlines {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px, transparent 3px,
        rgba(0,0,0,0.04) 3px, rgba(0,0,0,0.04) 4px
    );
    animation: scanScroll 12s linear infinite;
}
@keyframes scanScroll {
    0%   { background-position: 0 0; }
    100% { background-position: 0 100px; }
}

/* ===== APP LAYOUT - FIXED SCROLL ===== */
.app-container {
    position: relative; 
    z-index: 2;
    width: 100%;
    min-height: 100vh;
    display: flex; 
    flex-direction: column;
    padding: 16px 20px 12px;
    overflow-x: hidden;
    overflow-y: visible;
}

/* ===== HEADER ===== */
.header {
    display: flex; 
    align-items: center; 
    gap: 24px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    position: relative;
    flex-wrap: wrap;
}

.header-controls {
    display: flex; 
    gap: 8px;
    margin-left: auto;
}

.header-brand {
    display: flex; 
    align-items: center; 
    gap: 10px;
}

.brand-dot {
    width: 10px; 
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent), 0 0 24px rgba(255,82,46,0.3);
    animation: brandPulse 2s ease-in-out infinite;
}
@keyframes brandPulse {
    0%,100% { transform: scale(1); box-shadow: 0 0 12px var(--accent); }
    50% { transform: scale(1.3); box-shadow: 0 0 20px var(--accent), 0 0 40px rgba(255,82,46,0.4); }
}

.header h1 {
    font-family: var(--font-mono);
    font-size: 2em;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}
.brand-accent {
    color: var(--accent);
    animation: brandPulse 2s ease-in-out infinite;
}

.header-sub {
    font-family: var(--font-mono);
    font-size: 0.6em;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    line-height: 1.4;
}

.icon-btn {
    width: 36px; 
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: all 0.2s;
}
.icon-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}
.icon-inner { line-height: 1; }

/* ===== PANELS - FIXED SCROLL ===== */
.main-content {
    flex: 1;
    display: flex;
    gap: 16px;
    overflow-y: visible;
    min-height: auto;
}

.control-panel {
    flex: 0 0 340px;
    display: flex; 
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 120px);
}

.preview-panel {
    flex: 1;
    display: flex; 
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 120px);
}

.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(24px);
    transition: border-color 0.3s;
    position: relative;
    overflow: hidden;
}
.glass-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    pointer-events: none;
}
.glass-panel:hover {
    border-color: rgba(255,255,255,0.12);
}

.section { padding: 18px 20px; }

.panel-header {
    display: flex; 
    align-items: center; 
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.panel-header h2 {
    font-family: var(--font-mono);
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    flex: 1;
}
.panel-tag {
    font-family: var(--font-mono);
    font-size: 0.58em;
    color: var(--accent);
    letter-spacing: 0.05em;
    background: var(--accent-dim);
    border: 1px solid rgba(255,82,46,0.2);
    padding: 2px 6px;
    border-radius: 2px;
}
.panel-header-right {
    display: flex; 
    align-items: center; 
    gap: 8px;
}
.library-count {
    font-family: var(--font-mono);
    font-size: 0.6em;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

/* ===== INPUTS ===== */
.input-group { margin-bottom: 14px; }
.input-group label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.58em;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    margin-bottom: 7px;
}
.select-wrap {
    position: relative;
}
.select-wrap select {
    width: 100%;
    padding: 9px 32px 9px 12px;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.75em;
    cursor: pointer;
    appearance: none;
    transition: border-color 0.2s, background 0.2s;
    outline: none;
}
body.light-theme .select-wrap select {
    background: rgba(0,0,0,0.05);
}
.select-wrap select:hover, .select-wrap select:focus {
    border-color: var(--accent);
    background: var(--accent-dim);
}
.select-arrow {
    position: absolute; 
    right: 10px; 
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85em;
    pointer-events: none;
}

/* ===== TOGGLE ===== */
.toggle-group { margin-bottom: 16px; }
.toggle-label {
    display: flex; 
    align-items: center; 
    gap: 12px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.62em;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    user-select: none;
}
.toggle-track {
    position: relative;
    display: inline-block;
    width: 36px; 
    height: 18px;
}
.toggle-track input { display: none; }
.toggle-thumb {
    position: absolute; 
    inset: 0;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    border-radius: 9px;
    transition: background 0.3s, border-color 0.3s;
}
.toggle-thumb::after {
    content: '';
    position: absolute;
    left: 2px; 
    top: 2px;
    width: 12px; 
    height: 12px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
}
.toggle-track input:checked ~ .toggle-thumb {
    background: var(--accent-dim);
    border-color: var(--accent);
}
.toggle-track input:checked ~ .toggle-thumb::after {
    left: 20px;
    background: var(--accent);
    box-shadow: 0 0 8px rgba(255,82,46,0.5);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 7px;
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.68em;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
    color: var(--text);
    white-space: nowrap;
}
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.2s;
}
.btn:hover::after { opacity: 1; }
.btn:hover { border-color: rgba(255,255,255,0.2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

.btn-record {
    background: rgba(255,82,46,0.15);
    border-color: rgba(255,82,46,0.4);
    color: var(--accent);
    flex: 1;
}
.btn-record:hover {
    background: rgba(255,82,46,0.25);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(255,82,46,0.2), inset 0 0 20px rgba(255,82,46,0.05);
}
.btn-dot {
    width: 8px; 
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: none;
    transition: all 0.3s;
}
.btn-record:hover .btn-dot {
    box-shadow: 0 0 8px var(--accent);
}

.btn-stop {
    background: rgba(255,59,48,0.1);
    border-color: rgba(255,59,48,0.3);
    color: var(--danger);
}
.btn-stop:hover {
    background: rgba(255,59,48,0.2);
    border-color: var(--danger);
}
.btn-square {
    width: 7px; 
    height: 7px;
    background: var(--danger);
    border-radius: 1px;
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
    font-size: 0.6em;
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }

.btn-xs { padding: 5px 10px; }

.btn-editor {
    flex: 1;
    font-size: 0.62em;
    padding: 9px 10px;
}
.btn-undo { flex: 0 0 auto; }

.btn-export {
    background: rgba(255,184,0,0.12);
    border-color: rgba(255,184,0,0.35);
    color: var(--accent-2);
}
.btn-export:hover {
    background: rgba(255,184,0,0.2);
    border-color: var(--accent-2);
    box-shadow: 0 0 20px rgba(255,184,0,0.15);
}

.button-group {
    display: flex; 
    gap: 8px; 
    margin-top: 8px;
}

/* ===== VIDEO LIBRARY ===== */
.library-section { flex: 1; min-height: 0; }
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    max-height: 280px;
    overflow-y: auto;
    padding: 2px;
}
.empty-library {
    grid-column: 1/-1;
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 10px;
    padding: 32px 20px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.65em;
    letter-spacing: 0.08em;
}
.empty-icon {
    font-size: 2.5em;
    color: var(--text-dim);
    animation: emptyPulse 3s ease-in-out infinite;
}
@keyframes emptyPulse {
    0%,100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    background: rgba(0,0,0,0.5);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.25s;
}
.video-thumbnail::before {
    content: '';
    position: absolute; 
    inset: 0;
    border-radius: var(--radius);
    border: 2px solid transparent;
    transition: border-color 0.2s;
    z-index: 2; 
    pointer-events: none;
}
.video-thumbnail:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.video-thumbnail:hover::before { border-color: var(--accent); }
.video-thumbnail.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 20px rgba(255,82,46,0.2); }
.video-thumbnail video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

.thumbnail-overlay {
    position: absolute; 
    bottom: 0; 
    left: 0; 
    right: 0;
    padding: 4px 6px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    font-family: var(--font-mono);
    font-size: 0.6em;
    text-align: center;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.7);
}
.thumbnail-delete {
    position: absolute; 
    top: 4px; 
    right: 4px;
    width: 20px; 
    height: 20px;
    border-radius: 2px;
    background: rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 9px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: all 0.2s; 
    z-index: 3;
    font-family: var(--font-mono);
}
.thumbnail-delete:hover { background: var(--danger); color: white; border-color: var(--danger); }

/* ===== PREVIEW VIDEO ===== */
.video-wrapper {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
}
.preview-video {
    width: 100%;
    border-radius: var(--radius);
    display: block;
    max-height: 320px;
    object-fit: contain;
    background: #000;
}
.preview-video.filter-grayscale { filter: grayscale(100%); }
.preview-video.filter-sepia { filter: sepia(100%); }
.preview-video.filter-invert { filter: invert(100%); }
.preview-video.filter-blur { filter: blur(4px); }

.video-overlay-corners {
    position: absolute; 
    inset: 0;
    pointer-events: none;
}
.video-overlay-corners span {
    position: absolute;
    width: 14px; 
    height: 14px;
    border-color: var(--accent);
    border-style: solid;
    opacity: 0;
    transition: opacity 0.3s;
}
.video-wrapper:hover .video-overlay-corners span { opacity: 0.7; }
.video-overlay-corners span:nth-child(1) { top:0; left:0; border-width:2px 0 0 2px; }
.video-overlay-corners span:nth-child(2) { top:0; right:0; border-width:2px 2px 0 0; }
.video-overlay-corners span:nth-child(3) { bottom:0; left:0; border-width:0 0 2px 2px; }
.video-overlay-corners span:nth-child(4) { bottom:0; right:0; border-width:0 2px 2px 0; }

/* ===== STATUS BAR ===== */
.status-bar {
    display: flex; 
    align-items: center; 
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 0.65em;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}
.status-dot {
    width: 6px; 
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-ready { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-recording {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
    animation: blinkDot 0.8s infinite;
}
@keyframes blinkDot {
    0%,100% { opacity: 1; }
    50% { opacity: 0.2; }
}
.status-bar.recording {
    border-color: rgba(255,82,46,0.3);
    color: var(--accent);
    background: rgba(255,82,46,0.05);
}

/* ===== RECORDING INDICATOR ===== */
.recording-indicator {
    position: fixed;
    top: 16px; 
    right: 16px;
    padding: 8px 16px;
    background: rgba(11,12,14,0.95);
    border: 1px solid var(--accent);
    border-radius: 4px;
    display: none; 
    align-items: center; 
    gap: 10px;
    z-index: 2000;
    font-family: var(--font-mono);
    font-size: 0.7em;
    letter-spacing: 0.1em;
    box-shadow: 0 0 30px rgba(255,82,46,0.2), inset 0 0 30px rgba(255,82,46,0.03);
}
.recording-indicator.active {
    display: flex;
    animation: slideInRight 0.3s cubic-bezier(.4,0,.2,1);
}
@keyframes slideInRight {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.rec-pulse-ring {
    position: absolute; 
    left: 14px;
    width: 20px; 
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    animation: pulsering 1.4s ease-out infinite;
    opacity: 0;
}
@keyframes pulsering {
    0% { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(1.8); opacity: 0; }
}
.rec-dot {
    width: 8px; 
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: blinkDot 0.8s infinite;
    flex-shrink: 0; 
    position: relative; 
    z-index: 1;
}
.rec-label {
    color: var(--accent);
    font-weight: 700;
}
#recordingTime { color: var(--text); }

/* ===== TIMELINE ===== */
.timeline-container {
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    transition: border 0.2s;
}
.timeline-ruler {
    height: 20px; 
    position: relative;
    margin-bottom: 6px;
    display: flex; 
    align-items: flex-end;
}
.timeline {
    position: relative;
    height: 90px;
    background: rgba(0,0,0,0.3);
    border-radius: var(--radius);
    overflow-x: auto; 
    overflow-y: hidden;
    cursor: pointer;
}
.timeline-track {
    position: relative; 
    height: 100%; 
    min-width: 100%;
}
.timeline-empty {
    position: absolute; 
    top: 50%; 
    left: 50%;
    transform: translate(-50%,-50%);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.62em;
    letter-spacing: 0.1em;
    white-space: nowrap;
    pointer-events: none;
}

.video-clip {
    position: absolute;
    height: 62px;
    background: linear-gradient(135deg, rgba(255,82,46,0.25) 0%, rgba(255,184,0,0.15) 100%);
    border: 1px solid rgba(255,82,46,0.4);
    border-radius: var(--radius);
    cursor: move;
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.6em;
    letter-spacing: 0.05em;
    overflow: hidden;
    top: 50%; 
    transform: translateY(-50%);
    transition: border-color 0.2s, height 0.15s;
    white-space: nowrap;
    padding: 0 10px;
}
.video-clip:hover {
    border-color: var(--accent);
    height: 68px;
    color: var(--text);
}

.trim-handle {
    position: absolute;
    width: 6px; 
    height: 100%;
    background: rgba(255,82,46,0.5);
    cursor: ew-resize; 
    top: 0;
}
.trim-handle.left  { left: 0; border-radius: 3px 0 0 3px; }
.trim-handle.right { right: 0; border-radius: 0 3px 3px 0; }
.trim-handle:hover { background: var(--accent); }

/* ===== EDITOR CONTROLS ===== */
.editor-controls {
    display: flex; 
    gap: 6px; 
    flex-wrap: wrap; 
    margin-top: 10px;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed; 
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 1000;
    justify-content: center; 
    align-items: center;
    backdrop-filter: blur(12px);
}
.modal.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    max-width: 580px; 
    width: 90%;
    max-height: 85vh; 
    overflow-y: auto;
    padding: 24px;
}
.help-content { max-width: 480px; }

.shortcuts-list { margin: 16px 0; }
.shortcut {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.72em;
    color: var(--text-muted);
}
.shortcut:last-child { border-bottom: none; }
kbd {
    background: rgba(255,82,46,0.12);
    border: 1px solid rgba(255,82,46,0.3);
    color: var(--accent);
    padding: 3px 8px;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.85em;
}

/* ===== CROP ===== */
.crop-container {
    position: relative; 
    width: 100%; 
    margin: 14px 0;
    background: #000; 
    border-radius: var(--radius); 
    overflow: hidden;
}
.crop-preview { width: 100%; display: block; }
.crop-area {
    position: absolute;
    border: 2px solid var(--accent);
    background: rgba(255,82,46,0.1);
    cursor: move;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
}
.crop-handle {
    position: absolute;
    width: 10px; 
    height: 10px;
    background: var(--accent);
    border: 2px solid var(--bg);
    border-radius: 50%;
}
.crop-handle.tl { top:-5px; left:-5px; cursor:nw-resize; }
.crop-handle.tr { top:-5px; right:-5px; cursor:ne-resize; }
.crop-handle.bl { bottom:-5px; left:-5px; cursor:sw-resize; }
.crop-handle.br { bottom:-5px; right:-5px; cursor:se-resize; }
.crop-controls { display:flex; gap:10px; margin-top:14px; }

/* ===== LOADING ===== */
.loading-overlay {
    display: none;
    position: fixed; 
    inset: 0;
    background: rgba(11,12,14,0.95);
    z-index: 3000;
    justify-content: center; 
    align-items: center;
    flex-direction: column; 
    gap: 20px;
}
.loading-overlay.active { display: flex; }

.loader-ring {
    width: 48px; 
    height: 48px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-right-color: rgba(255,82,46,0.3);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loader-text {
    font-family: var(--font-mono);
    font-size: 0.65em;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    animation: blinkDot 1.2s ease-in-out infinite;
}

/* ===== NOTIFICATIONS ===== */
.notification-container {
    position: fixed; 
    bottom: 16px; 
    right: 16px;
    z-index: 4000;
    display: flex; 
    flex-direction: column; 
    gap: 8px;
    pointer-events: none;
}
.notification {
    background: rgba(11,12,14,0.97);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.65em;
    letter-spacing: 0.06em;
    display: flex; 
    align-items: center; 
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    pointer-events: all;
    animation: notifIn 0.3s cubic-bezier(.4,0,.2,1);
    min-width: 220px; 
    max-width: 320px;
    backdrop-filter: blur(12px);
}
@keyframes notifIn {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
.notification span { flex: 1; color: var(--text-muted); }
.notification button { background:none; border:none; color:var(--text-dim); cursor:pointer; font-size:1.1em; line-height:1; }
.notification button:hover { color: var(--danger); }
.notification.success { border-left-color: var(--success); }
.notification.error   { border-left-color: var(--danger); }
.notification.warning { border-left-color: var(--accent-2); }

/* ===== AUDIO VISUALIZER ===== */
.audio-visualizer {
    position: fixed; 
    bottom: 16px; 
    left: 16px;
    width: 180px; 
    height: 52px;
    background: rgba(11,12,14,0.9);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    display: none; 
    align-items: flex-end; 
    justify-content: center;
    gap: 2px; 
    z-index: 1000;
    padding: 6px 10px;
}
.audio-visualizer.active { display: flex; }
.audio-bar {
    width: 3px;
    background: var(--accent);
    border-radius: 1px 1px 0 0;
    min-height: 2px;
    transition: height 0.05s ease;
    box-shadow: 0 0 4px rgba(255,82,46,0.3);
}

/* ===== PROGRESS ===== */
.progress-container {
    position: fixed; 
    bottom: 70px; 
    left: 50%; 
    transform: translateX(-50%);
    width: 280px;
    background: rgba(11,12,14,0.97);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: none; 
    z-index: 2000;
    backdrop-filter: blur(12px);
}
.progress-container.active { display: block; }
.progress-bar {
    width: 100%; 
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px; 
    overflow: hidden; 
    margin: 8px 0;
}
.progress-fill {
    width: 0%; 
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 2px;
    transition: width 0.3s ease;
}
.progress-text {
    font-family: var(--font-mono);
    font-size: 0.62em;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-align: center;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,82,46,0.25); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,82,46,0.5); }

/* ===== RESPONSIVE ===== */
@media (max-width: 968px) {
    .main-content { flex-direction: column; }
    .control-panel { 
        flex: 0 0 auto; 
        max-height: 400px;
    }
    .preview-panel {
        max-height: 500px;
    }
    .glass-panel { padding: 14px; }
    .header h1 { font-size: 1.5em; }
    .video-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
    .editor-controls .btn { font-size: 0.58em; padding: 8px 8px; }
}
@media (max-width: 480px) {
    .app-container { padding: 8px; }
    .button-group { flex-direction: column; }
    .header-sub { display: none; }
}