:root {
    --bg-app: #f5f5f7;
    --bg-panel: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent: #0066cc;
    --accent-soft: rgba(0, 102, 204, 0.1);
    --border: #d2d2d7;
    --timeline-height: 60px;
    --spacing: 20px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-app: #1c1c1e;
        --bg-panel: #2c2c2e;
        --text-primary: #f5f5f7;
        --text-secondary: #86868b;
        --border: #3a3a3c;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Split View */
.split-view {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.video-section {
    flex: 1;
    padding: var(--spacing);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

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

video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Drop Zone */
.empty-state {
    position: absolute;
    inset: 0;
    background: var(--bg-panel);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 10;
    border: 2px dashed var(--border);
    transition: all 0.2s ease;
}

.empty-state.dragover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.upload-icon {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.empty-state h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.upload-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.upload-btn:hover {
    opacity: 0.9;
}

/* Transcript Section */
.transcript-section {
    width: 450px;
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.transcript-header {
    padding: 12px var(--spacing);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.processing-bar {
    height: 2px;
    background: var(--border);
    position: relative;
    overflow: hidden;
}

.processing-bar.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: processing-slide 1.5s infinite ease-in-out;
}

@keyframes processing-slide {
    0% {
        left: -50%;
    }

    100% {
        left: 100%;
    }
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.search-box {
    flex: 1;
    min-width: 100px;
    max-width: 180px;
}

.search-box input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-app);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--accent);
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.transcript-segment.search-match {
    background: rgba(255, 200, 0, 0.2);
}

.transcript-segment.search-match.current-match {
    background: rgba(255, 200, 0, 0.4);
    border-left: 3px solid #ffc800;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.status-dot.active {
    background: var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.transcript-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.icon-btn:hover {
    background: var(--bg-app);
    color: var(--text-primary);
}

.transcript-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing);
    scroll-behavior: smooth;
}

.transcript-segment {
    margin-bottom: 16px;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
    cursor: pointer;
}

.transcript-segment:hover {
    background: var(--bg-app);
}

.transcript-segment.active {
    background: var(--accent-soft);
}

.segment-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-feature-settings: "tnum";
}

.segment-text {
    line-height: 1.5;
    font-size: 1rem;
}

.placeholder-text {
    color: var(--text-secondary);
    text-align: center;
    margin-top: 40px;
    font-style: italic;
}

/* Timeline */
.timeline-bar {
    height: var(--timeline-height);
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 var(--spacing);
    gap: 16px;
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.play-pause-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-display,
.timeline-duration {
    font-size: 0.9rem;
    font-feature-settings: "tnum";
    color: var(--text-secondary);
    min-width: 45px;
}

.timeline-track-container {
    flex: 1;
    height: 30px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.timeline-track {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--text-primary);
    width: 0%;
}

.timeline-buffer {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--accent);
    opacity: 0.3;
    width: 0%;
    z-index: 0;
}