/* ===== YouTube Script Generator — design system ===== */

/* Font */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== Sidebar ===== */
.sidebar {
    width: 248px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100%;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    height: 56px;
    border-bottom: 1px solid #e2e8f0;
}
.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    background: #e65b5b;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-logo-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}
.sidebar-logo-sub {
    font-size: 9px;
    color: #94a3b8;
    line-height: 1;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px 12px 4px;
    font-weight: 600;
}
.nav-link {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.15s;
    text-decoration: none;
    margin-bottom: 2px;
}
.nav-link:hover {
    background: #f1f5f9;
    color: #1e293b;
}
.nav-link.active {
    background: rgba(230,91,91,0.1);
    color: #e65b5b;
    font-weight: 600;
}
.nav-icon {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    flex-shrink: 0;
}

/* Sidebar user */
.sidebar-user {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}
.sidebar-user-role {
    font-size: 10px;
    color: #94a3b8;
    text-transform: capitalize;
}
.sidebar-logout {
    color: #94a3b8;
    transition: color 0.15s;
}
.sidebar-logout:hover {
    color: #64748b;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    text-decoration: none;
}
.btn-primary { background: #e65b5b; color: white; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: #f1f5f9; color: #64748b; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #FF3B30; color: white; }
.btn-danger:hover { opacity: 0.9; }

.btn-sm {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}
.btn-sm.btn-primary { background: #e65b5b; color: white; }
.btn-sm.btn-primary:hover { opacity: 0.9; }
.btn-sm.btn-secondary { background: #f1f5f9; color: #64748b; }
.btn-sm.btn-secondary:hover { background: #e2e8f0; }
.btn-sm.btn-danger { background: rgba(255,59,48,0.1); color: #FF3B30; }
.btn-sm.btn-danger:hover { background: rgba(255,59,48,0.15); }

/* ===== Inputs ===== */
.input {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    transition: all 0.15s;
    background: #ffffff;
}
.input:focus {
    border-color: #e65b5b;
    box-shadow: 0 0 0 3px rgba(230,91,91,0.15);
}

/* ===== Table ===== */
.th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.td {
    padding: 10px 16px;
    font-size: 13px;
    color: #1e293b;
}

/* ===== Status badges ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}
.status-created { background: #f1f5f9; color: #64748b; }
.status-querying { background: rgba(139,92,246,0.1); color: #8B5CF6; }
.status-searching { background: rgba(139,92,246,0.1); color: #8B5CF6; }
.status-filtering { background: rgba(139,92,246,0.1); color: #8B5CF6; }
.status-ranking { background: rgba(139,92,246,0.1); color: #8B5CF6; }
.status-awaiting_selection { background: rgba(255,149,0,0.1); color: #FF9500; }
.status-transcribing { background: rgba(230,91,91,0.1); color: #e65b5b; }
.status-extracting { background: rgba(230,91,91,0.1); color: #e65b5b; }
.status-generating_script { background: rgba(230,91,91,0.1); color: #e65b5b; }
.status-fact_checking { background: rgba(230,91,91,0.1); color: #e65b5b; }
.status-completed { background: rgba(52,199,89,0.1); color: #34C759; }
.status-failed { background: rgba(255,59,48,0.1); color: #FF3B30; }
.status-cancelled { background: #f1f5f9; color: #94a3b8; }
.status-pending { background: #f1f5f9; color: #94a3b8; }
.status-running { background: rgba(230,91,91,0.1); color: #e65b5b; }

/* ===== Progress bar ===== */
.progress-bar {
    background: #e2e8f0;
    border-radius: 9999px;
    height: 6px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    background: #e65b5b;
    transition: width 0.3s ease;
}

/* ===== Prompt tabs ===== */
.prompt-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    transition: color 0.15s;
}
.prompt-tab:hover {
    color: #1e293b;
}
.prompt-tab.active {
    color: #e65b5b;
    border-bottom-color: #e65b5b;
    font-weight: 600;
}

/* ===== Toast ===== */
.toast {
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
    max-width: 24rem;
}
.toast-success { background: #e65b5b; color: white; }
.toast-error { background: #FF3B30; color: white; }
.toast-info { background: #e65b5b; color: white; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== Stat cards ===== */
.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(226,232,240,0.6);
    transition: box-shadow 0.15s;
}
.stat-card:hover {
    box-shadow: 0 4px 12px -2px rgba(0,0,0,0.08);
}
.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: #1e293b;
}
.stat-label {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px;
}

/* ===== Mobile header ===== */
.mobile-header {
    display: none;
}

/* ===== Responsive ===== */
@media (max-width: 1023px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .mobile-header {
        display: flex;
    }
}

@media (max-width: 767px) {
    .btn { padding: 10px 18px; font-size: 14px; }
    .btn-sm { padding: 6px 12px; font-size: 13px; }
    .th { padding: 8px 10px; font-size: 10px; }
    .td { padding: 8px 10px; font-size: 12px; }
}
