/* 
  Ultron Cut - UI/UX Styling 
  Theme: Cyberpunk / Modern Dark Mode / Glassmorphism
  Author: Designer-Delta
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --bg-main: #050505;
    --bg-surface: #121214;
    --bg-surface-elevated: #1e1e24;
    --bg-glass: rgba(18, 18, 20, 0.75);
    
    /* Neon Cyberpunk Accents */
    --accent-primary: #00f0ff;
    --accent-secondary: #7000ff;
    --accent-glow: rgba(0, 240, 255, 0.4);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    
    /* UI Elements */
    --border-light: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(0, 240, 255, 0.6);
    
    /* Tracks */
    --track-video-start: #0f172a;
    --track-video-end: #1e3a8a;
    --track-audio-start: #064e3b;
    --track-audio-end: #047857;
}

/* ---------- Global Reset ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
}

/* ---------- Top Navigation ---------- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    z-index: 100;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.logo i {
    color: var(--accent-primary);
    filter: drop-shadow(0 0 10px var(--accent-glow));
    font-size: 1.5rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn-small {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.icon-btn-small:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    transform: rotate(30deg);
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-primary), #00a2ff);
    color: #000;
    border: none;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--accent-glow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.primary-btn i {
    font-size: 1.1rem;
}

.primary-btn:hover {
    box-shadow: 0 6px 25px rgba(0, 240, 255, 0.7);
    transform: translateY(-2px) scale(1.02);
}

.primary-btn:active {
    transform: translateY(1px) scale(0.96);
}

/* ---------- Video Preview Section ---------- */
.preview-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #181822 0%, #050505 100%);
    position: relative;
    overflow: hidden;
    padding-top: 72px; /* Top nav height offset */
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#video-canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.9);
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px;
}

.time-stamp {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'ui-monospace', 'SF Mono', monospace;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.5px;
}

.fullscreen-btn {
    pointer-events: auto;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
    color: var(--accent-primary);
}

/* ---------- Bottom Sheet Workspace ---------- */
.editor-workspace {
    height: 48vh;
    min-height: 380px;
    background: var(--bg-surface);
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.9);
    z-index: 10;
    position: relative;
    border-top: 1px solid var(--border-light);
}

/* Workspace Grab Indicator */
.editor-workspace::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* ---------- Playback Controls ---------- */
.playback-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px 16px;
    border-bottom: 1px solid var(--border-light);
    background: transparent;
}

.time-current {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'ui-monospace', 'SF Mono', monospace;
    color: var(--accent-primary);
    text-shadow: 0 0 16px var(--accent-glow);
    letter-spacing: 1px;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 24px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.icon-btn:hover {
    color: var(--accent-primary);
    background: rgba(0, 240, 255, 0.1);
}

.icon-btn:active {
    transform: scale(0.9);
}

.secondary-btn {
    color: var(--text-muted);
    font-size: 1.15rem;
}
.secondary-btn:hover {
    color: var(--text-primary);
    background: var(--border-light);
}

.play-btn {
    width: 56px;
    height: 56px;
    background: var(--text-primary);
    color: var(--bg-main);
    border-radius: 50%;
    font-size: 1.4rem;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.play-btn:hover {
    background: var(--accent-primary);
    color: #000;
    box-shadow: 0 0 30px var(--accent-glow);
    transform: scale(1.1);
}

.play-btn:active {
    transform: scale(0.95);
}

/* ---------- Timeline Area ---------- */
.timeline-container {
    flex: 1;
    position: relative;
    background: var(--bg-main);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* The Playhead */
.playhead {
    position: absolute;
    top: 0;
    left: 50%;
    bottom: 0;
    width: 2px;
    background: var(--accent-primary);
    z-index: 50;
    transform: translateX(-50%);
    pointer-events: none;
    box-shadow: 0 0 12px var(--accent-glow);
}

.playhead-head {
    width: 16px;
    height: 24px;
    background: var(--accent-primary);
    border-radius: 0 0 8px 8px;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.playhead-head::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #000;
    border-radius: 50%;
}

.timeline-scroll-area {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    padding: 0 50vw; /* Keeps playhead visually centered on clip start */
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    cursor: grab;
    /* Cyberpunk Grid Background */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

.timeline-scroll-area:active {
    cursor: grabbing;
}

.timeline-scroll-area::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.timeline-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.timeline-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.timeline-scroll-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Timeline Ruler */
.timeline-ruler {
    height: 32px;
    background: rgba(18, 18, 20, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 40;
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 49px,
        rgba(255, 255, 255, 0.15) 49px,
        rgba(255, 255, 255, 0.15) 50px
    );
}

/* Timeline Tracks */
.timeline-tracks {
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 3000px;
}

.track {
    height: 76px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    display: flex;
    position: relative;
    margin-right: 24px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: background-color 0.2s;
}

.track:hover {
    background: rgba(255, 255, 255, 0.05);
}

.track-header {
    width: 60px;
    background: var(--bg-surface-elevated);
    border-right: 1px solid var(--border-light);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    position: sticky;
    left: 0;
    z-index: 30;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    font-size: 1.25rem;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.6);
}

.track-content {
    position: relative;
    flex: 1;
}

/* Clips */
.clip {
    position: absolute;
    top: 8px;
    height: 58px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s;
    user-select: none;
}

.clip:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
}

.video-clip {
    background: linear-gradient(90deg, var(--track-video-start), var(--track-video-end));
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.audio-clip {
    background: linear-gradient(90deg, var(--track-audio-start), var(--track-audio-end));
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.selected-clip {
    border: 2px solid var(--accent-primary);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.3), 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 5;
}

.selected-clip:hover {
    transform: translateY(-2px) scale(1.01);
}

.clip-label {
    position: relative;
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
    letter-spacing: 0.4px;
}

.clip-thumbnails {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(0,0,0,0.15) 0px,
        rgba(0,0,0,0.15) 10px,
        rgba(0,0,0,0.3) 10px,
        rgba(0,0,0,0.3) 20px
    );
    opacity: 0.6;
    z-index: 1;
}

.audio-clip .waveform {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.2) 2px, transparent 2px);
    background-size: 8px 100%;
    z-index: 1;
}

/* Clip Resize Handles */
.clip-handles {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 18px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 3;
    cursor: ew-resize;
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

.clip-handles::after {
    content: '';
    width: 2px;
    height: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
}

.clip-handles:hover {
    background: rgba(255, 255, 255, 0.35);
}

.clip-handles:hover::after {
    background: #fff;
    box-shadow: 0 0 5px #fff;
}

.left-handle { 
    left: 0; 
    border-right: 1px solid rgba(0,0,0,0.3);
}
.right-handle { 
    right: 0; 
    border-left: 1px solid rgba(0,0,0,0.3);
}

/* ---------- Bottom Toolbar ---------- */
.bottom-toolbar {
    height: 96px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-light);
    padding: 0 8px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 20;
}

.toolbar-scroll {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    width: 100%;
    padding: 0 16px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    scroll-behavior: smooth;
}

.toolbar-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.tool-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    min-width: 76px;
    height: 80px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
}

.tool-btn:hover, .tool-btn:active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tool-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-light);
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.02);
}

.tool-btn:hover .tool-icon {
    background: var(--bg-surface-elevated);
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--accent-primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.tool-btn:active .tool-icon {
    transform: translateY(-2px);
}

.tool-btn span {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 480px) {
    .top-nav {
        padding: 12px 16px;
    }
    
    .editor-workspace {
        height: 52vh;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }
    
    .playback-controls {
        padding: 20px 20px 12px;
    }
    
    .time-current {
        font-size: 1.2rem;
    }
    
    .control-buttons {
        gap: 16px;
    }
    
    .icon-btn {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
    
    .play-btn {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
    
    .bottom-toolbar {
        height: 84px;
    }
    
    .tool-btn {
        min-width: 68px;
        height: 70px;
    }
    
    .tool-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
    
    .tool-btn span {
        font-size: 0.7rem;
    }
}
```