/* 3D Beveled Panel Styles */
.panel-3d {
    background: 
        linear-gradient(145deg, #1c1c1c 0%, #0a0a0a 50%, #000000 100%),
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
    border-radius: 12px;
    position: relative;
    box-shadow: 
        /* Deep outer shadows */
        0 20px 40px rgba(0, 0, 0, 0.9),
        0 8px 16px rgba(0, 0, 0, 0.8),
        0 2px 8px rgba(0, 0, 0, 0.6),
        /* Inner bevel highlights */
        inset 0 1px 2px rgba(255, 255, 255, 0.15),
        inset 0 -2px 4px rgba(0, 0, 0, 0.9),
        inset 1px 0 2px rgba(255, 255, 255, 0.08),
        inset -1px 0 2px rgba(0, 0, 0, 0.8),
        /* Subtle inner glow */
        inset 0 0 20px rgba(255, 255, 255, 0.02);
    border: 1px solid #333;
    border-top-color: #444;
    border-left-color: #222;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    overflow-x: hidden;
}

.panel-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
    border-radius: 8px 8px 0 0;
}

/* Custom Scrollbar Styles */
.panel-3d::-webkit-scrollbar,
.timeline-panel::-webkit-scrollbar {
    width: 8px;
}

.panel-3d::-webkit-scrollbar-track,
.timeline-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.panel-3d::-webkit-scrollbar-thumb,
.timeline-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.panel-3d::-webkit-scrollbar-thumb:hover,
.timeline-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Design System Variables - Black, White & Grey */
:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #141414;
    --bg-panel: #1a1a1a;
    --bg-hover: #252525;
    --border-subtle: #2a2a2a;
    --border-strong: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #6a6a6a;
    --accent-primary: #ffffff;
    --accent-secondary: #888888;
    --accent-glow: rgba(255, 255, 255, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.9);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Font imports */
@font-face {
    font-family: 'Brutalism';
    src: url('fonts/Brutalism.otf') format('opentype');
}

@font-face {
    font-family: 'DarkTech';
    src: url('fonts/darktech_ldr.ttf') format('truetype');
}

@font-face {
    font-family: 'Fathead';
    src: url('fonts/Fathead_PersonalUseOnly.ttf') format('truetype');
}

@font-face {
    font-family: 'LDR2';
    src: url('fonts/LDR2.ttf') format('truetype');
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.timeline-top {
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border-bottom: 1px solid var(--border-subtle);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
}

.tips-section {
    background: #0d0d0d;
    border-bottom: 1px solid #333;
    padding: 10px 15px;
    overflow: hidden;
}

.tips-content {
    max-width: 100%;
}

.tips-header {
    color: #ff00ff;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 8px;
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tips-list {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 5px;
}

.tips-list::-webkit-scrollbar {
    height: 4px;
}

.tips-list::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 2px;
}

.tips-list::-webkit-scrollbar-thumb {
    background: #ff00ff;
    border-radius: 2px;
}

.tip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 0, 255, 0.05);
    border: 1px solid rgba(255, 0, 255, 0.2);
    border-radius: 4px;
    padding: 6px 10px;
    white-space: nowrap;
    font-size: 11px;
    color: #ccc;
    transition: all 0.2s ease;
}

.tip:hover {
    background: rgba(255, 0, 255, 0.1);
    border-color: rgba(255, 0, 255, 0.4);
    color: #fff;
}

.tip-icon {
    font-size: 14px;
}

.tip-text {
    font-family: monospace;
}

.video-track-container,
.audio-track-container {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
}

.audio-track-container {
    background: rgba(255, 0, 255, 0.02);
}

.video-track-container {
    transition: border 0.3s ease;
    cursor: pointer;
}

.video-track-container.selected {
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.video-track-container-base {
    background: rgba(0, 255, 136, 0.02);
}

.audio-track-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 12px;
}

.audio-timeline {
    height: 54px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    border: 1px solid var(--border-subtle);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.audio-clips {
    display: flex;
    height: 100%;
    width: fit-content;
    min-width: fit-content;
}

.audio-clip {
    height: 100%;
    background: linear-gradient(135deg, var(--bg-panel) 0%, var(--bg-tertiary) 100%);
    margin-right: 4px;
    border-radius: var(--radius-sm);
    display: block;
    color: var(--text-primary);
    font-size: 10px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    min-width: 150px;
    padding: 0;
    cursor: pointer;
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.audio-clip:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--accent-primary);
}

.audio-clip canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.audio-clip-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    padding: 2px 5px;
    font-size: 9px;
    color: #888;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    z-index: 2;
}

.audio-clip.active {
    border-color: #ff00ff;
}

.audio-clip.active .audio-clip-label {
    color: #ff00ff;
    background: rgba(255, 0, 255, 0.1);
}

.audio-playhead {
    position: absolute;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
    top: 0;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 0 10px var(--accent-glow);
    border-radius: 2px;
}

.main-container {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #000;
    padding: 8px;
    gap: 8px;
}

.effect-item {
    margin-bottom: 16px;
    padding: 12px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    border-radius: 6px;
    border: 1px solid #000;
    transition: all 200ms ease;
    position: relative;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(0, 0, 0, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.6);
}

.effect-item:hover {
    background: linear-gradient(135deg, #1f1f1f 0%, #141414 100%);
    transform: translateY(-1px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.8),
        0 4px 8px rgba(0, 0, 0, 0.7);
}

.video-viewer {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, 
        rgba(131, 56, 236, 0.12) 0%, 
        rgba(255, 0, 110, 0.06) 25%,
        rgba(0, 255, 136, 0.03) 50%,
        #000000 70%
    );
    max-height: 100%;
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        inset 0 0 100px rgba(131, 56, 236, 0.2),
        inset 0 0 200px rgba(0, 0, 0, 0.8);
}

.video-viewer::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center,
        transparent 25%,
        rgba(0, 0, 0, 0.5) 70%
    );
    pointer-events: none;
}

#videoCanvas {
    display: block !important;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 0 80px rgba(131, 56, 236, 0.3),
        0 0 40px rgba(255, 0, 110, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    position: relative;
    z-index: 1;
    background: #000;
}

.super-effects-panel {
    width: 200px;
    background: #0a0a0a;
    padding: 15px;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a0020 0%, #0a0015 100%);
}

.effects-panel {
    width: 200px;
    background: 
        linear-gradient(145deg, #1c1c1c 0%, #0a0a0a 50%, #000000 100%),
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
    padding: 15px;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.1),
        inset 0 -1px 2px rgba(0, 0, 0, 0.8),
        inset 1px 0 1px rgba(255, 255, 255, 0.05),
        inset -1px 0 1px rgba(0, 0, 0, 0.6);
    border-radius: 0 8px 8px 0;
}

.canvas-panel {
    width: 180px;
    background: #1a1a1a;
    padding: 15px;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: calc(100vh - 20px);
}

.canvas-title {
    color: white;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: left;
}

.canvas-sizes {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.size-category {
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.category-label {
    color: #ff4081;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 8px;
}

.filters-panel {
    width: 180px;
    background: #1a1a1a;
    padding: 15px;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.filters-title {
    color: white;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: left;
}

.text-panel {
    width: 220px;
    background: #1a1a1a;
    padding: 15px;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.text-title {
    color: white;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: left;
}

.text-chunk {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 10px;
}

.text-input {
    width: 100%;
    background: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 5px;
    margin-bottom: 5px;
    font-size: 12px;
}

.font-select {
    width: 100%;
    background: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 3px;
    font-size: 11px;
    margin-bottom: 5px;
}



.filter-button {
    background: #333;
    color: #ccc;
    border: 1px solid #555;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 8px;
    transition: all 0.3s;
    text-align: center;
}

.filter-button:hover {
    background: #444;
    border-color: #00ff88;
}

.filter-button.active {
    background: #00ff88;
    color: #000;
    border-color: #00ff88;
}

.effects-title {
    color: white;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: left;
}

.effect-item {
    margin-bottom: 15px;
}

.effect-label {
    color: #ccc;
    font-size: 12px;
    margin-bottom: 5px;
    display: block;
}

.effect-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    cursor: pointer;
}

.effect-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.expand-toggle {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    transition: transform 0.2s ease, color 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
}

.expand-toggle:hover {
    color: #fff;
}

.expand-toggle.expanded {
    transform: rotate(90deg);
}

.effect-controls {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    max-height: 200px;
    opacity: 1;
}

.effect-controls.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 25px;
    background: #333;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

.toggle-switch.active {
    background: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6), inset 0 1px 3px rgba(0,0,0,0.3);
}

/* Unique colors for different effects */
#glitchToggle.active {
    background: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.6), inset 0 1px 3px rgba(0,0,0,0.3);
}

#randomSeekToggle.active {
    background: linear-gradient(135deg, #ffaa00 0%, #ff6600 100%);
    box-shadow: 0 0 15px rgba(255, 170, 0, 0.6), inset 0 1px 3px rgba(0,0,0,0.3);
}

/* Super Effects toggle colors when active */
#ultraGlitchToggle.active {
    background: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.6), inset 0 1px 3px rgba(0,0,0,0.3);
}

#timeWarpToggle.active {
    background: linear-gradient(135deg, #ff4081 0%, #ff0066 100%);
    box-shadow: 0 0 15px rgba(255, 64, 129, 0.6), inset 0 1px 3px rgba(0,0,0,0.3);
}

#realityBreakToggle.active {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6), inset 0 1px 3px rgba(0,0,0,0.3);
}

#dimensionShiftToggle.active {
    background: linear-gradient(135deg, #00ffff 0%, #00cccc 100%);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.6), inset 0 1px 3px rgba(0,0,0,0.3);
}

#quantumFluxToggle.active {
    background: linear-gradient(135deg, #ff00ff 0%, #cc00cc 100%);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.6), inset 0 1px 3px rgba(0,0,0,0.3);
}

#fractalModeToggle.active {
    background: linear-gradient(135deg, #ff6b4a 0%, #ff4444 100%);
    box-shadow: 0 0 15px rgba(255, 107, 74, 0.6), inset 0 1px 3px rgba(0,0,0,0.3);
}

#kaleidoscopeToggle.active {
    background: linear-gradient(135deg, #4a6bff 0%, #3366ff 100%);
    box-shadow: 0 0 15px rgba(74, 107, 255, 0.6), inset 0 1px 3px rgba(0,0,0,0.3);
}

/* Checkbox styling for effects */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
    accent-color: #ffffff;
}

label:has(input[type="checkbox"]:checked) {
    color: #ffffff !important;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    transition: all 0.3s;
}

/* Specific colors for different effect checkboxes */
label:has(#vignetteToggle:checked) {
    color: #cccccc !important;
    text-shadow: 0 0 8px rgba(204, 204, 204, 0.6);
}

label:has(#cycleFiltersToggle:checked) {
    color: #ffaa00 !important;
    text-shadow: 0 0 8px rgba(255, 170, 0, 0.6);
}

label:has(#randomFiltersToggle:checked) {
    color: #00aaff !important;
    text-shadow: 0 0 8px rgba(0, 170, 255, 0.6);
}

/* Filter checkboxes */
.filter-toggles label:has(input:checked) {
    color: #00ff88 !important;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 21px;
    height: 21px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch.active .toggle-slider {
    transform: translateX(25px);
}

.slider-control {
    margin-top: 8px;
}

.slider {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, #ffffff 0%, #ffffff 0%, #333 0%, #333 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(131, 56, 236, 0.3);
}

.slider::-moz-range-track {
    background: #333;
    height: 4px;
    border-radius: 2px;
}

.slider::-moz-range-progress {
    background: #ffffff;
    height: 4px;
    border-radius: 2px;
}

.slider-value {
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
    margin-top: 3px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.triple-slider {
    position: relative;
    width: 100%;
    height: 30px;
    margin: 10px 0;
}

.triple-slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    transform: translateY(-50%);
}

.triple-slider-range {
    position: absolute;
    top: 50%;
    height: 4px;
    background: #ff4081;
    border-radius: 2px;
    transform: translateY(-50%);
}

.triple-slider-handle {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    background: #fff;
    border: 2px solid #ff4081;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.2s;
}

.triple-slider-handle:hover {
    background: #ff4081;
    transform: translate(-50%, -50%) scale(1.2);
}

.triple-slider-handle.main {
    border-color: #00ff88;
    z-index: 3;
}

.triple-slider-handle.main:hover {
    background: #00ff88;
}

.triple-slider-handle.min {
    border-color: #ff6b4a;
    z-index: 2;
}

.triple-slider-handle.max {
    border-color: #4a6bff;
    z-index: 2;
}

.triple-slider-values {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 11px;
    color: #888;
}

.mini-toggle {
    width: 30px;
    height: 15px;
    background: #333;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    position: relative;
}

.mini-toggle.active {
    background: #ffffff;
}

.mini-toggle-slider {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 13px;
    height: 13px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.mini-toggle.active .mini-toggle-slider {
    transform: translateX(15px);
}

.video-viewer {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, var(--bg-tertiary) 0%, var(--bg-primary) 100%);
    max-height: 100%;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

#videoCanvas {
    border: 1px solid var(--border-subtle);
    object-fit: contain;
    width: 400px !important;
    height: 400px !important;
    aspect-ratio: 1 !important;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    transition: all var(--transition-smooth);
}

.timeline-panel {
    width: 300px;
    background: #1a1a1a;
    padding: 15px;
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    overflow-x: hidden;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.timeline-header h2 {
    color: #ffffff;
    font-size: 16px;
    margin: 0;
    font-weight: bold;
}

.timeline-status {
    color: #00ff88;
    font-size: 12px;
    font-weight: bold;
}

.timeline {
    height: 90px;
    background: #333;
    border-radius: 6px;
    position: relative;
    overflow-x: scroll;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    margin: 5px 0;
    box-shadow: inset 0 -2px 5px rgba(0,0,0,0.3);
}

/* Style the scrollbar */
.timeline::-webkit-scrollbar {
    height: 8px;
}

.timeline::-webkit-scrollbar-track {
    background: #222;
    border-radius: 4px;
}

.timeline::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.timeline::-webkit-scrollbar-thumb:hover {
    background: #777;
}

.timeline:active {
    cursor: grabbing;
}

.timeline::-webkit-scrollbar {
    height: 10px;
}

.timeline::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.timeline::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    border-radius: var(--radius-sm);
    border: 2px solid var(--bg-secondary);
}

.timeline::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-clips {
    display: flex;
    height: 100%;
    width: fit-content;
    min-width: fit-content;
}

.clip {
    height: 100%;
    background: linear-gradient(45deg, #ffffff, #888888);
    margin-right: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    width: 100px;
    border: 2px solid rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, filter 0.2s;
}

.clip:hover {
    transform: scale(1.05);
    border-color: rgba(255,255,255,0.5);
    filter: brightness(1.1);
}

.clip.active {
    border-color: #ffff00;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.6);
}

.clip-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    border-radius: 3px;
}

.clip-number {
    position: relative;
    z-index: 10;
    background: rgba(0,0,0,0.7);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
}

.playback-head {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #00ff88, #00cc66);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5), 0 0 40px rgba(0, 255, 136, 0.3);
    z-index: 200;
    transition: left 0.1s linear;
    border-radius: 2px;
    pointer-events: none;
}

.controls {
    margin-bottom: 20px;
}

.btn {
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    color: #fff;
    border: 1px solid #000;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: all 200ms ease;
    position: relative;
    box-shadow: 
        /* Outer shadow for depth */
        0 4px 8px rgba(0, 0, 0, 0.8),
        0 1px 3px rgba(0, 0, 0, 0.9),
        /* Top highlight */
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        /* Bottom shadow */
        inset 0 -1px 0 rgba(0, 0, 0, 0.5),
        /* Side highlights */
        inset 1px 0 0 rgba(255, 255, 255, 0.08),
        inset -1px 0 0 rgba(0, 0, 0, 0.5);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 100%);
    border-radius: 6px 6px 0 0;
    pointer-events: none;
}

.btn:hover {
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
    transform: translateY(-1px);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.9),
        0 2px 4px rgba(0, 0, 0, 1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.6);
}

.btn:active {
    background: linear-gradient(180deg, #1a1a1a 0%, #151515 100%);
    transform: translateY(1px);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.8),
        inset 0 1px 2px rgba(0, 0, 0, 0.8),
        inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

/* Primary action buttons get accent color */
.btn#playBtn, .btn#recordBtn {
    background: linear-gradient(180deg, #777 0%, #555 100%);
    border-color: #444;
}

.btn#playBtn:hover, .btn#recordBtn:hover {
    background: linear-gradient(180deg, #ff4488 0%, #ff2277 100%);
}

.btn#playBtn:active, .btn#recordBtn:active {
    background: linear-gradient(180deg, #666 0%, #444 100%);
}

.btn.secondary {
    background: linear-gradient(180deg, #2a2a2f 0%, #1a1a1f 100%);
    border-color: #0a0a0f;
}

.btn.secondary:hover {
    background: linear-gradient(180deg, #3a3a4f 0%, #2a2a3f 100%);
}

.btn.secondary:active {
    background: linear-gradient(180deg, #1a1a1f 0%, #15151a 100%);
}

/* Black Gloss/Glass Checkbox and Toggle Styling */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(145deg, #2a2a2f 0%, #1a1a1f 50%, #0a0a0f 100%);
    border: 1px solid #333;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.1),
        inset 0 -1px 2px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="checkbox"]:hover {
    background: linear-gradient(145deg, #3a3a3f 0%, #2a2a2f 50%, #1a1a1f 100%);
    border-color: #444;
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.15),
        inset 0 -1px 2px rgba(0, 0, 0, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.3);
}

input[type="checkbox"]:checked {
    background: linear-gradient(145deg, #00ff88 0%, #00cc66 50%, #009944 100%);
    border-color: #00ff88;
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2),
        0 0 8px rgba(0, 255, 136, 0.3);
}

input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: #000;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}

/* Active/Pressed Effect */
input[type="checkbox"]:active {
    transform: scale(0.95);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.4),
        0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Label Styling for Better Integration */
label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
    cursor: pointer;
    transition: color 0.2s ease;
}

label:hover {
    color: #fff;
}

.status {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 10px;
}

.info-panel {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.info-label {
    color: #999;
}

.info-value {
    color: #fff;
    font-weight: bold;
}

.hidden-video {
    display: none;
}

/* Dark Theme Styles */
body.dark-theme {
    background: #050505;
}

body.dark-theme .timeline-top {
    background: #0a0a0a;
    border-bottom: 1px solid #1a1a1a;
}

body.dark-theme .effects-panel,
body.dark-theme .super-effects-panel,
body.dark-theme .filters-panel,
body.dark-theme .canvas-panel,
body.dark-theme .text-panel {
    background: #0f0f0f;
    border: 1px solid #1a1a1a;
}

body.dark-theme .control-group {
    color: #888;
}

body.dark-theme .control-group:hover {
    background: rgba(255, 255, 255, 0.02);
}

body.dark-theme .btn {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #888;
}

body.dark-theme .btn:hover {
    background: #222;
    color: #aaa;
}

body.dark-theme .toggle-switch {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
}

body.dark-theme .slider {
    background: #1a1a1a;
}

body.dark-theme input[type="radio"],
body.dark-theme input[type="checkbox"] {
    filter: brightness(0.7);
}

body.dark-theme .timeline-container {
    background: #080808;
    border: 1px solid #1a1a1a;
}

body.dark-theme .category-label {
    color: #666;
}

body.dark-theme .effect-label {
    color: #888;
}

body.dark-theme .status {
    background: #0a0a0a;
    color: #666;
}

/* ===== MOBILE COMPLETE REDESIGN ===== */
@media screen and (max-width: 768px) {
    /* Mobile-first: Single scrollable page */
    body {
        display: block;
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
        min-height: 100vh;
        background: #000;
        padding: 0;
        margin: 0;
    }
    
    /* Hide desktop timeline completely */
    .timeline-top {
        display: none;
    }
    
    /* Convert main container to simple block layout */
    .main-container {
        display: block;
        width: 100%;
        padding: 0;
        margin: 0;
        height: auto;
        overflow: visible;
    }
    
    /* Show desktop panels stacked vertically on mobile */
    .super-effects-panel,
    .effects-panel,
    .filters-panel,
    .text-panel {
        display: block !important;
        width: 100% !important;
        margin: 12px 0 !important;
        max-height: none !important;
        overflow-y: visible !important;
        height: auto !important;
    }
    
    /* Mobile video section - simple and static */
    .video-viewer {
        width: 100%;
        height: 40vh;
        padding: 16px;
        margin: 0 0 16px 0;
        position: static;
        background: #000;
        display: flex;
        align-items: center;
        justify-content: center;
        border-bottom: 1px solid #333;
    }
    
    #videoCanvas {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        border-radius: 8px;
        border: 1px solid #333;
    }
    
    /* Simple play button for mobile */
    #canvasPlayBtn {
        width: 100px !important;
        height: 100px !important;
        font-size: 40px !important;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.9) !important;
        color: #000 !important;
        border: none !important;
        z-index: 1000 !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    }
    
    /* Larger, more touch-friendly controls */
    .effect-item {
        margin-bottom: 20px;
        padding: 16px;
        border-radius: 12px;
    }
    
    .effect-header {
        padding: 12px 0;
        min-height: 48px;
        align-items: center;
    }
    
    .effect-label {
        font-size: 16px !important;
        font-weight: 600;
    }
    
    .toggle-switch {
        width: 60px !important;
        height: 36px !important;
        border-radius: 18px !important;
    }
    
    .toggle-slider {
        width: 32px !important;
        height: 32px !important;
        border-radius: 16px !important;
        margin: 2px !important;
    }
    
    .toggle-switch.active .toggle-slider {
        transform: translateX(24px) !important;
    }
    
    /* Larger sliders */
    .slider {
        height: 8px !important;
        margin: 16px 0 !important;
        border-radius: 4px !important;
    }
    
    .slider::-webkit-slider-thumb {
        width: 24px !important;
        height: 24px !important;
        border-radius: 12px !important;
    }
    
    /* Better spacing for controls */
    .effect-controls {
        padding: 16px 0 8px 0;
        gap: 12px;
    }
    
    /* More readable text */
    .effects-title,
    .filters-title,
    .text-effects-title {
        font-size: 18px !important;
        margin-bottom: 20px;
        padding: 12px 0;
    }
    
    /* Expand toggles more visible */
    .expand-toggle {
        font-size: 16px;
        width: 32px;
        text-align: center;
    }
    
    /* Better filter grid on mobile */
    .filter-toggles {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        margin: 16px 0;
    }
    
    .filter-item {
        padding: 12px !important;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
    }
    
    /* Timeline improvements */
    .timeline-container,
    .audio-timeline-container {
        margin: 8px 0;
        padding: 12px;
    }
    
    .timeline,
    .audio-timeline {
        padding: 12px 0;
        touch-action: pan-x;
    }
    
    /* Playback controls */
    .playback-controls {
        gap: 16px;
        margin: 16px 0;
    }
    
    .btn {
        min-height: 44px;
        padding: 12px 20px !important;
        font-size: 14px;
        border-radius: 8px;
        font-weight: 600;
    }
    
    /* Text effects mobile improvements */
    .text-controls {
        gap: 16px;
    }
    
    .text-input {
        padding: 12px !important;
        font-size: 16px !important;
        border-radius: 8px;
        min-height: 44px;
    }
    
    /* Tips section mobile */
    .tips-section {
        padding: 12px 16px;
    }
    
    .tips-list {
        gap: 12px;
        padding-bottom: 8px;
    }
    
    .tip {
        padding: 8px 12px;
        white-space: nowrap;
        border-radius: 6px;
        font-size: 13px;
    }
    
    /* Panel spacing improvements */
    .panel-3d {
        margin: 12px 0 !important;
        padding: 20px 16px !important;
        border-radius: 16px;
        max-height: none !important;
        overflow: visible !important;
        height: auto !important;
    }
    
    /* Ensure good contrast and readability */
    .effect-controls span,
    .control-group span {
        font-size: 14px !important;
        line-height: 1.4;
    }
    
    /* Remove individual panel scrollbars on mobile */
    .panel-3d::-webkit-scrollbar {
        display: none;
    }
    
    /* Make sure no element has independent scrolling on mobile */
    .super-effects-panel,
    .effects-panel, 
    .filters-panel,
    .text-panel {
        max-height: none !important;
        overflow-y: visible !important;
        height: auto !important;
    }
    
    /* AIVJ button mobile optimization */
    #demoBtn {
        top: 10px !important;
        right: 10px !important;
        padding: 12px 20px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
        min-height: 44px !important; /* Apple's minimum touch target */
        min-width: 60px !important;
        touch-action: manipulation; /* Disable zoom on tap */
    }
    
    /* Touch-friendly buttons */
    .btn {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 12px 16px !important;
        font-size: 16px !important;
        touch-action: manipulation;
    }
    
    /* Better mobile video canvas */
    .main-content-left {
        width: 100% !important;
        min-height: 60vh !important;
        margin: 0 !important;
        padding: 10px !important;
    }
    
    #videoCanvas {
        width: 100% !important;
        height: 50vh !important;
        max-height: none !important;
        border-radius: 12px !important;
        touch-action: none; /* Allow pinch zoom on canvas */
    }
    
    /* Mobile-optimized controls */
    .mobile-controls {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        display: flex !important;
        gap: 15px;
        background: rgba(0,0,0,0.9);
        padding: 15px 20px;
        border-radius: 20px;
        border: 1px solid #333;
        z-index: 8888;
    }
    
    /* Hide complex controls on mobile, show only essentials */
    .filter-toggles {
        display: none !important;
    }
    
    .effects-controls {
        display: none !important;
    }
}

/* Tablet optimizations */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .main-container {
        gap: 12px;
        padding: 8px;
    }
    
    .super-effects-panel,
    .effects-panel,
    .filters-panel,
    .text-panel {
        flex: 0 0 320px;
    }
    
    .video-viewer {
        flex: 1;
        min-width: 400px;
    }
}