:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-light: #eef2ff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --accent-light: #1e1b4b;
    --border: #334155;
    --border-light: #1e293b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-img {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
}

/* Hero Section */
.hero {
    padding: 80px 0 60px;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}

.url-input-group {
    display: flex;
    gap: 12px;
    max-width: 640px;
    margin: 0 auto;
}

.url-input {
    flex: 1;
    padding: 16px 20px;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all var(--transition);
    outline: none;
}

.url-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}

.url-input::placeholder {
    color: var(--text-tertiary);
}

.btn-primary {
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    border: none;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: white;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Workspace */
.workspace {
    display: none;
    padding: 40px 0;
}

.workspace.active {
    display: block;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 32px;
    align-items: start;
}

/* Player Column */
.player-column {
    position: sticky;
    top: 90px;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-lg);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-meta {
    margin-top: 16px;
}

.video-meta h2 {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

.video-meta p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* AI Actions */
.ai-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.ai-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ai-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.ai-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.ai-btn .ai-badge {
    font-size: 0.625rem;
    background: var(--accent);
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: 600;
}

.ai-btn.active .ai-badge {
    background: rgba(255,255,255,0.2);
}

/* AI Usage Counter */
.ai-usage {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 12px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

/* Transcript Column */
.transcript-column {
    min-height: 400px;
}

.transcript-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.toolbar-btn {
    padding: 8px 12px;
    font-size: 0.8125rem;
    font-family: var(--font-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.toolbar-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
}

.toolbar-spacer {
    flex: 1;
}

.language-select {
    padding: 8px 12px;
    font-size: 0.8125rem;
    font-family: var(--font-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
}

/* Transcript Content */
.transcript-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    max-height: 600px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.transcript-content::-webkit-scrollbar {
    width: 6px;
}

.transcript-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.transcript-content::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 3px;
}

.transcript-line {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 4px;
}

.transcript-line:hover {
    background: var(--bg-secondary);
}

.transcript-line.active {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
}

.transcript-line.excluded {
    opacity: 0.4;
    text-decoration: line-through;
}

.transcript-time {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--accent);
    white-space: nowrap;
    min-width: 50px;
}

.transcript-text {
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.6;
}

/* AI Output */
.ai-output {
    margin-top: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
}

.ai-output-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--accent);
}

.ai-output-content {
    font-size: 0.9375rem;
    line-height: 1.7;
}

.ai-output-content ul {
    padding-left: 20px;
    margin: 12px 0;
}

.ai-output-content li {
    margin-bottom: 8px;
}

.ai-output-content p {
    margin-bottom: 12px;
}

.ai-output-content h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--accent);
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-line {
    height: 20px;
    margin-bottom: 12px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 16px;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Features Section */
.features {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 16px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 48px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    padding: 32px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* Use Cases */
.use-cases {
    padding: 80px 0;
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.use-case-card {
    padding: 32px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.use-case-card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.use-case-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* How It Works */
.how-it-works {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.step-card {
    text-align: center;
    padding: 40px 32px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.step-number {
    width: 56px;
    height: 56px;
    background: var(--accent);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.step-card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.step-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Why Section */
.why-section {
    padding: 80px 0;
}

.why-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.why-text p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 1.0625rem;
}

.why-benefits {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.benefit-item {
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.benefit-item strong {
    display: block;
    font-size: 1.0625rem;
    margin-bottom: 8px;
    color: var(--accent);
}

.benefit-item p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* FAQ */
.faq {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-question {
    width: 100%;
    padding: 24px 0;
    font-size: 1.0625rem;
    font-weight: 600;
    font-family: var(--font-heading);
    text-align: left;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color var(--transition);
}

.faq-question:hover {
    color: var(--accent);
}

.faq-icon {
    font-size: 1.5rem;
    transition: transform var(--transition);
    color: var(--text-tertiary);
}

.faq-item.open .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
    padding-bottom: 24px;
}

.faq-answer p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Footer */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-disclaimer {
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }
    
    .player-column {
        position: static;
    }
    
    .url-input-group {
        flex-direction: column;
    }
    
    .ai-actions {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    
    .ai-btn {
        min-width: auto;
        flex: 0 0 auto;
    }
    
    .transcript-toolbar {
        flex-wrap: wrap;
    }
    
    .hero {
        padding: 48px 0 32px;
    }
    
    .features, .use-cases, .faq, .how-it-works, .why-section {
        padding: 48px 0;
    }
    
    .why-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}

/* Remove Sections Tool */
.remove-sections-panel {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.remove-sections-panel.active {
    display: block;
}

/* Full Text Panel */
.fulltext-panel {
    margin-top: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.fulltext-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.fulltext-header h4 {
    font-size: 0.9375rem;
    font-weight: 600;
}

.fulltext-content {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.fulltext-content::-webkit-scrollbar {
    width: 6px;
}

.fulltext-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.fulltext-content::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 3px;
}

.remove-sections-panel h4 {
    font-size: 0.9375rem;
    margin-bottom: 12px;
}

.section-range {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.section-range input {
    padding: 8px 12px;
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    width: 80px;
    outline: none;
}

.section-range span {
    color: var(--text-tertiary);
}

/* Export Dropdown */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 50;
    min-width: 140px;
}

.export-menu.active {
    display: block;
}

.export-option {
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-family: var(--font-body);
    text-align: left;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition);
}

.export-option:hover {
    background: var(--bg-secondary);
}

.export-option:first-child {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.export-option:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.hidden {
    display: none !important;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}
