/* ============================================
   YouTube Transcript Tool Styles
   ============================================ */

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-card: #151515;
    --bg-card-hover: #1e1e1e;
    --accent-primary: #00d4ff;
    --accent-primary-hover: #00b8e6;
    --accent-primary-glow: rgba(0, 212, 255, 0.15);
    --accent-secondary: #7c3aed;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --border-color: #222222;
    --border-color-light: #333333;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Space Grotesk', var(--font-sans);
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { font-family: var(--font-sans); background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; min-height: 100vh; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; }

.page-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.container { max-width: 900px; margin: 0 auto; padding: 0 1.5rem; }

/* ===== Header ===== */
.site-header {
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}
.logo:hover { color: var(--text-primary); }

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--bg-primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}
.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color var(--transition-fast);
}
.nav-links a:hover { color: var(--text-primary); }

/* ===== Page Header ===== */
.page-header {
    text-align: center;
    padding: 3rem 0 2rem;
}
.page-header h1 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Input Section ===== */
.input-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.url-input-group {
    display: flex;
    gap: 0.75rem;
}

.url-input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}
.url-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary-glow);
}
.url-input::placeholder { color: var(--text-muted); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-primary-hover);
    box-shadow: 0 0 20px var(--accent-primary-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color-light);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-md);
}
.btn-icon:hover:not(:disabled) {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.input-hint {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== Options Bar ===== */
.options-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.lang-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
}
.lang-select:focus { border-color: var(--accent-primary); }

.options-right {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.toggle-btn:hover { color: var(--text-primary); border-color: var(--accent-primary); }
.toggle-btn.active {
    background: var(--accent-primary-glow);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* ===== Status / Loading ===== */
.status-area {
    text-align: center;
    padding: 2rem 0;
}

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color-light);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-text {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.error-text {
    color: var(--accent-danger);
    font-size: 0.9rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
}

/* ===== Video Info ===== */
.video-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.video-thumbnail {
    width: 120px;
    height: 68px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.video-meta h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta-details {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== Transcript Output ===== */
.transcript-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.transcript-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.transcript-toolbar .label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: auto;
}

.transcript-body {
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    scroll-behavior: smooth;
}

.transcript-body::-webkit-scrollbar { width: 6px; }
.transcript-body::-webkit-scrollbar-track { background: transparent; }
.transcript-body::-webkit-scrollbar-thumb { background: var(--border-color-light); border-radius: 3px; }
.transcript-body::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.transcript-line {
    display: flex;
    gap: 1rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    cursor: default;
}
.transcript-line:hover { background: rgba(255, 255, 255, 0.04); }

.transcript-time {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-primary);
    min-width: 60px;
    padding-top: 0.15rem;
    cursor: pointer;
    user-select: none;
}
.transcript-time:hover { text-decoration: underline; }

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

.transcript-line.no-timestamps .transcript-time { display: none; }
.transcript-line.no-timestamps .transcript-text { padding-left: 0; }

/* Plain text mode */
.transcript-body.plain-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ===== Word count / Stats ===== */
.transcript-stats {
    display: flex;
    gap: 1.5rem;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.transcript-stats span { display: flex; align-items: center; gap: 0.3rem; }

/* ===== Privacy Notice ===== */
.privacy-notice {
    text-align: center;
    padding: 1.5rem 0 3rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.privacy-notice strong { color: var(--text-secondary); }

/* ===== Footer ===== */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
}
.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.footer-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.footer-links {
    display: flex;
    gap: 1.5rem;
}
.footer-links a {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: none;
    transition: color var(--transition-fast);
}
.footer-links a:hover { color: var(--text-primary); }

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color-light);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
    pointer-events: none;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ===== Hidden ===== */
.hidden { display: none !important; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .container { padding: 0 1rem; }
    .url-input-group { flex-direction: column; }
    .options-bar { flex-direction: column; align-items: stretch; }
    .options-right { margin-left: 0; justify-content: flex-end; }
    .video-info { flex-direction: column; text-align: center; }
    .video-thumbnail { width: 100%; height: auto; max-width: 280px; }
    .transcript-toolbar { flex-direction: column; align-items: stretch; gap: 0.5rem; }
    .transcript-toolbar .label { margin-right: 0; }
    .transcript-stats { flex-direction: column; gap: 0.25rem; }
    .footer-content { flex-direction: column; text-align: center; }
    .nav-links { gap: 1rem; }
}

@media (max-width: 480px) {
    .nav-links { display: none; }
    .page-header { padding: 2rem 0 1.5rem; }
    .page-header h1 { font-size: 1.5rem; }
}
