/* === VideoSub Backoffice Styles === */

:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #e94560;
    --accent-hover: #c73650;
    --text: #eee;
    --text-muted: #aaa;
    --bg: #0f3460;
    --bg-light: #f5f5f5;
    --card-bg: #fff;
    --border: #ddd;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: #333;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--primary);
    color: var(--text);
    padding: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 30px 20px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 { font-size: 1.6rem; }

.nav-menu { padding: 15px 0; flex: 1; }

.nav-item {
    display: block;
    padding: 12px 25px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    cursor: pointer;
}

.nav-item:hover { background: rgba(255,255,255,0.1); color: var(--text); }

.btn-logout { color: var(--accent); }
.btn-logout:hover { background: var(--accent); color: white; }

.nav-menu hr { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 10px 0; }

.user-info {
    padding: 15px 25px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: var(--text-muted);
}

/* Sidebar Submenu */
.nav-submenu { position: relative; }

.nav-submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.submenu-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.submenu-arrow.open { transform: rotate(180deg); }

.nav-subitem {
    padding-left: 40px !important;
    font-size: 0.88rem !important;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px 40px;
    overflow-y: auto;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 25px;
    margin-bottom: 20px;
}

.card h3 { margin-bottom: 15px; color: var(--primary); }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stat-card .stat-number { font-size: 2rem; font-weight: bold; }
.stat-card .stat-label { color: #666; font-size: 0.85rem; margin-top: 5px; }
.stat-card.total .stat-number { color: var(--info); }
.stat-card.completed .stat-number { color: var(--success); }
.stat-card.failed .stat-number { color: var(--danger); }
.stat-card.pending .stat-number { color: var(--warning); }

/* Chart placeholder */
.chart-container {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chart-bar-container { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 20px; }

.chart-bar {
    flex: 1;
    background: var(--accent);
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    position: relative;
    transition: height 0.3s;
}

.chart-bar:hover { opacity: 0.8; }

.chart-bar .bar-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #666;
    white-space: nowrap;
}

.chart-bar .bar-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--primary);
}

/* Forms */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #444;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-control:focus { outline: none; border-color: var(--accent); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:hover { background: #5a6268; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #218838; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c82333; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1.1rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin: 0 -25px;
    padding: 0 25px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table th {
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.table tr:hover { background: rgba(0,0,0,0.02); }

.table .actions-cell {
    display: flex;
    gap: 4px;
    white-space: nowrap;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Key display */
.key-display {
    background: #1a1a2e;
    color: #0f0;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    margin: 10px 0;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header h1 { color: var(--primary); font-size: 1.6rem; }

/* Language bar chart */
.lang-bar {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.lang-bar .lang-name { width: 100px; font-size: 0.85rem; text-align: right; }
.lang-bar .lang-fill { height: 22px; background: var(--accent); border-radius: 3px; transition: width 0.3s; }
.lang-bar .lang-count { font-size: 0.8rem; color: #666; }

/* === Landing Page === */
.landing-page {
    max-width: 900px;
    margin: 0 auto;
}

.landing-hero {
    text-align: center;
    padding: 60px 20px 40px;
}

.landing-hero h1 {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 15px;
}

.hero-description {
    color: #666;
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto 30px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.landing-section {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 40px 30px;
    margin-bottom: 25px;
}

.landing-section h2 {
    color: var(--primary);
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 15px;
}

.section-description {
    color: #555;
    text-align: center;
    max-width: 650px;
    margin: 0 auto 30px;
    line-height: 1.6;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.feature-card {
    text-align: center;
    padding: 20px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: box-shadow 0.2s;
}

.feature-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.feature-icon { font-size: 2.5rem; margin-bottom: 10px; }

.feature-card h3 {
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 8px;
}

.feature-card p { color: #666; font-size: 0.88rem; line-height: 1.5; }

/* Steps */
.steps-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.step {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
}

.step h3 {
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 4px;
}

.step p { color: #666; font-size: 0.9rem; line-height: 1.5; }

/* API highlights */
.api-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.api-highlight {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.api-highlight strong { color: var(--primary); display: block; margin-bottom: 8px; }
.api-highlight p { color: #666; font-size: 0.88rem; line-height: 1.5; }

/* CTA */
.landing-cta {
    text-align: center;
    padding: 40px 20px;
    background: var(--primary);
    border-radius: 10px;
    margin-bottom: 25px;
}

.landing-cta h2 { color: white; margin-bottom: 10px; }
.landing-cta p { color: var(--text-muted); margin-bottom: 20px; }

/* === Code Tabs (API Examples) === */
.code-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
}

.code-tab {
    padding: 10px 24px;
    border: none;
    background: #e0e0e0;
    color: #555;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    border-radius: 6px 6px 0 0;
}

.code-tab:hover { background: #d0d0d0; }

.code-tab.active {
    background: var(--primary);
    color: white;
}

.code-card {
    border-radius: 0 10px 10px 10px;
    margin-top: 0;
}

pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 10px 0;
}

pre code {
    font-family: 'Courier New', Consolas, Monaco, monospace;
}

code {
    background: #eee;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 0.88rem;
}

pre code {
    background: none;
    padding: 0;
}

/* === Extract Page (Subtitle Generator) === */
.extract-page {
    max-width: 800px;
    margin: 0 auto;
}

.extract-header {
    text-align: center;
    padding: 30px 20px 20px;
}

.extract-header h1 {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 5px;
}

.extract-header p {
    color: #666;
    font-size: 0.95rem;
}

.extract-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 25px;
}

.extract-card h2 {
    color: var(--primary);
    margin-bottom: 20px;
    text-align: center;
}

/* Upload zone */
.upload-zone {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: #fafafa;
}

.upload-zone:hover {
    border-color: var(--accent);
    background: #fff0f3;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.upload-zone p { color: #666; }

.upload-zone .file-name {
    color: var(--accent);
    font-weight: bold;
    margin-top: 10px;
}

select.form-control { cursor: pointer; }

/* Progress */
.progress-container { margin: 20px 0; }

.progress-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.5s;
}

.status-text {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
}

/* Results */
.result-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    margin-top: 20px;
}

.result-card h3 {
    color: var(--success);
    margin-bottom: 15px;
}

.download-link {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    margin: 8px;
    transition: background 0.2s;
}

.download-link:hover { background: #218838; }

/* Error */
.error-card {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    margin-top: 20px;
}

.error-card h3 {
    color: var(--danger);
    margin-bottom: 10px;
}

/* Extract page info section */
.extract-info {
    margin-top: 10px;
}

.extract-info-section {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 30px;
    margin-bottom: 20px;
}

.extract-info-section h2 {
    color: var(--primary);
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 12px;
}

.extract-info-section > p {
    color: #555;
    text-align: center;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
    font-size: 0.95rem;
}

.extract-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.extract-feature {
    text-align: center;
    padding: 18px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.extract-feature-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.extract-feature h3 {
    color: var(--primary);
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.extract-feature p {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
}

.extract-api-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 18px;
}

.extract-api-item {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.extract-api-item strong {
    color: var(--primary);
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.extract-api-item p {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
}

.extract-footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 0.85rem;
}

/* === Sortable table headers === */
.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sortable-th:hover {
    background: rgba(0,0,0,0.05);
}

/* === Modal overlay for delete confirmation === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-dialog h3 {
    color: var(--primary);
    margin-bottom: 15px;
}

/* === Warning button === */
.btn-warning {
    background: #f0ad4e;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-warning:hover {
    background: #ec971f;
}
