/* V-Producer Admin Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Login Page ===== */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    width: 400px;
    max-width: 90%;
}

.login-card h1 {
    font-size: 24px;
    color: #1d1d1d;
    margin-bottom: 8px;
    text-align: center;
}

.login-card .subtitle {
    font-size: 14px;
    color: #999;
    text-align: center;
    margin-bottom: 30px;
}

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

.sidebar {
    width: 240px;
    background: #1a1a2e;
    color: #fff;
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar .brand {
    padding: 0 20px 20px;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
    color: #667eea;
}

.sidebar .nav-item {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s;
    cursor: pointer;
}

.sidebar .nav-item:hover,
.sidebar .nav-item.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar .nav-section {
    padding: 12px 20px 4px;
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    letter-spacing: 1px;
    margin-top: 10px;
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* ===== Header Bar ===== */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.topbar h2 {
    font-size: 22px;
    color: #1d1d1d;
    font-weight: 500;
}

.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #666;
}

.topbar .btn-logout {
    background: none;
    border: 1px solid #ddd;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.2s;
}

.topbar .btn-logout:hover {
    background: #fee;
    border-color: #fcc;
    color: #c00;
}

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

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stat-card .stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #1d1d1d;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #999;
    margin-top: 4px;
}

.stat-card.pending { border-left: 3px solid #f59e0b; }
.stat-card.approved { border-left: 3px solid #10b981; }
.stat-card.rejected { border-left: 3px solid #ef4444; }

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.form-group label .required {
    color: #e00;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: auto;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #667eea;
    color: #fff;
}

.btn-primary:hover { background: #5568d3; }

.btn-success {
    background: #10b981;
    color: #fff;
}

.btn-success:hover { background: #059669; }

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover { background: #dc2626; }

.btn-outline {
    background: #fff;
    color: #667eea;
    border: 1px solid #667eea;
}

.btn-outline:hover { background: #f5f7ff; }

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Tables ===== */
.table-wrapper {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-group select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
}

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

table th {
    text-align: left;
    padding: 12px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fafbfc;
    border-bottom: 1px solid #eee;
}

table td {
    padding: 14px 20px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
    color: #333;
}

table tr:last-child td { border-bottom: none; }

table tr:hover td { background: #fafbff; }

/* ===== Status Badges ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 480px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-box h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #1d1d1d;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ===== Messages ===== */
.alert {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* ===== Pagination ===== */
.page-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 16px;
}

.page-nav button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
}

.page-nav button:hover:not(:disabled) { background: #f5f5f5; }
.page-nav button.active { background: #667eea; color: #fff; border-color: #667eea; }
.page-nav button:disabled { opacity: 0.4; cursor: default; }

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ===== Loading ===== */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ===== Video link in table ===== */
.video-link {
    color: #005aed;
    text-decoration: none;
    font-weight: 500;
}

.video-link:hover { text-decoration: underline; }

/* ===== Script preview ===== */
.script-preview {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    color: #999;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .sidebar { width: 100%; padding: 10px 0; }
    .sidebar .nav-item { display: inline-block; padding: 8px 14px; }
    .main-content { padding: 16px; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    table { font-size: 13px; }
    table th, table td { padding: 10px 12px; }
}

/* Moderation badges */
.badge-moderation-warning { background: #fff3cd; color: #856404; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-moderation-flagged { background: #fde8e8; color: #c53030; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }

/* Checkbox groups for industry multi-select */
.checkbox-group { max-height: 400px; overflow-y: auto; border: 1px solid #ddd; border-radius: 6px; padding: 12px; }
.checkbox-group label { display: block; padding: 4px 0; font-size: 14px; cursor: pointer; }
.checkbox-group label.level-2 { padding-left: 24px; }
.checkbox-group label.level-3 { padding-left: 48px; }
.checkbox-group label.level-4 { padding-left: 72px; }

/* Section visibility helper */
.section-hidden { display: none; }

/* Page nav active */
.page-nav button.active { background: #667eea; color: #fff; font-weight: bold; }

/* ========== Review Panels ========== */
.review-panel-overlay {
    display: none;
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 2000;
    justify-content: center; align-items: flex-start; padding-top: 20px;
    overflow-y: auto;
}
.review-panel-overlay.show { display: flex; }
.review-panel-box {
    background: #fff; width: 95%; max-width: 960px; border-radius: 10px;
    margin-bottom: 40px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex; flex-direction: column; max-height: 90vh;
}
.review-panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px; border-bottom: 1px solid #eee;
}
.review-panel-header h3 { margin: 0; font-size: 18px; color: #333; }
.btn-close-panel {
    background: none; border: none; font-size: 28px; cursor: pointer;
    color: #999; line-height: 1;
}
.btn-close-panel:hover { color: #333; }
.review-panel-body {
    padding: 20px 24px; overflow-y: auto; flex: 1;
}
.review-panel-footer {
    padding: 14px 24px; border-top: 1px solid #eee;
    display: flex; gap: 8px; justify-content: flex-end; background: #fafafa;
    border-radius: 0 0 10px 10px;
}

/* Form rows for multi-column layouts */
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 150px; }

/* Badge moderation */
.badge-moderation-warning {
    background: #fff3cd; color: #856404; padding: 2px 8px;
    border-radius: 10px; font-size: 11px; font-weight: 600;
}
.badge-moderation-flagged {
    background: #fde8e8; color: #c53030; padding: 2px 8px;
    border-radius: 10px; font-size: 11px; font-weight: 600;
}

/* Checkbox group for tree-based selections */
.checkbox-group { background: #f9fafb; border-radius: 6px; }

/* Site settings textarea */
#siteHeaderHtml, #siteFooterHtml { background: #1e1e1e; color: #d4d4d4; }

/* Tag modal */
#tagFormModal > div { width: 90%; max-width: 520px; }

/* Template editor */
.template-tabs { display: flex; gap: 4px; }
.template-tabs .btn { padding: 6px 14px; font-size: 13px; border: 1px solid #ddd; background: #f5f5f5; cursor: pointer; border-radius: 4px; }
.template-tabs .btn.active { background: #667eea; color: #fff; border-color: #667eea; }
.tp-section-tabs .btn { padding: 4px 12px; font-size: 12px; border: 1px solid #ddd; background: #f5f5f5; cursor: pointer; border-radius: 4px; }
.tp-section-tabs .btn.active { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.code-editor { font-family: 'Consolas', 'Courier New', monospace; font-size: 12px; background: #1e1e1e; color: #d4d4d4; width: 100%; padding: 8px; border: 1px solid #333; border-radius: 4px; line-height: 1.4; }

