/* ============================================================
   Movi Admin — Design System (MagicUI Blue Theme)
   Primary: #0066FF · Surface: #030712 · Card: #0b0f19
   ============================================================ */
:root {
    /* Backgrounds */
    --bg-dark: #030712;
    --bg-card: #0b0f19;
    --bg-sidebar: #070a13;
    --bg-hover: rgba(255, 255, 255, 0.025);

    /* Accent colours */
    --accent-primary: #0066ff;    /* Royal Blue — all primary actions */
    --accent-purple: #0066ff;     /* legacy alias  */
    --accent-blue: #0066ff;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;        /* Destructive only */
    --accent-ai: #0fbcf9;         /* AI / Gemini actions */

    /* Text */
    --text-main: #f1f5f9;
    --text-muted: #64748b;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.07);
    --border-focus: rgba(0, 102, 255, 0.35);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    /* Transitions */
    --transition: all 0.18s ease;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── App Layout ─────────────────────────────────────────── */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
    width: 236px;
    min-width: 236px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 16px 20px 16px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.brand-icon {
    font-size: 22px;
    color: var(--accent-primary);
}

.brand-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.brand-name span {
    color: var(--accent-primary);
    font-weight: 400;
    margin-left: 1px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
    overflow-y: auto;
    padding: 8px 12px;
    scrollbar-width: none;
}
.nav-menu::-webkit-scrollbar { display: none; }

.nav-section-title {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    padding: 10px 10px 3px 10px;
    text-transform: uppercase;
    user-select: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
}

.nav-item i {
    font-size: 14px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item:hover {
    color: var(--text-main);
    background-color: var(--bg-hover);
}

.nav-item.active {
    background-color: var(--bg-hover);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

/* DB Status Badge */
.db-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.db-badge.connected    { background-color: rgba(16,185,129,0.08); color: var(--accent-green); }
.db-badge.disconnected { background-color: rgba(245,158,11,0.08); color: var(--accent-orange); }

.db-badge.connected .indicator    { background-color: var(--accent-green);  box-shadow: 0 0 6px var(--accent-green); }
.db-badge.disconnected .indicator { background-color: var(--accent-orange); box-shadow: 0 0 6px var(--accent-orange); }

.indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ── Main Content ───────────────────────────────────────── */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 22px;
    background-color: var(--bg-dark);
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.header-title h1 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 2px;
}

.header-title p {
    color: var(--text-muted);
    font-size: 12.5px;
}

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

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: #fff;
}
.btn-primary:hover {
    background-color: #0052cc;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 102, 255, 0.25);
}

.btn-success {
    background-color: var(--accent-green);
    color: #fff;
}
.btn-success:hover { background-color: #059669; }

.btn-danger {
    background-color: var(--accent-red);
    color: #fff;
}
.btn-danger:hover { background-color: #dc2626; }

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { background-color: rgba(255, 255, 255, 0.1); }

.btn-purple {
    background-color: var(--accent-ai);
    color: #fff;
}
.btn-purple:hover {
    background-color: #00a8e8;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11.5px;
    border-radius: 5px;
}

.btn-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    transition: var(--transition);
    font-size: 12px;
    flex-shrink: 0;
}
.btn-icon:hover                { background-color: rgba(255, 255, 255, 0.08); color: var(--text-main); }
.btn-icon.edit:hover           { color: var(--accent-primary); }
.btn-icon.delete:hover         { color: var(--accent-red); }

/* ── Tab Panels ─────────────────────────────────────────── */
.tab-panel {
    display: none;
    flex-direction: column;
    animation: fadeIn 0.22s ease;
}
.tab-panel.active { display: flex; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Stats Cards ────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}
.stat-card:hover { border-color: rgba(255,255,255,0.12); }

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.stat-icon.purple { background-color: rgba(0,102,255,0.08);   color: var(--accent-primary); }
.stat-icon.green  { background-color: rgba(16,185,129,0.08);  color: var(--accent-green);   }
.stat-icon.blue   { background-color: rgba(0,102,255,0.08);   color: var(--accent-blue);    }
.stat-icon.orange { background-color: rgba(245,158,11,0.08);  color: var(--accent-orange);  }

.stat-info { display: flex; flex-direction: column; }

.stat-label {
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 500;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    margin-top: 1px;
    letter-spacing: -0.5px;
}

/* ── Overview Banner (kept for future use) ─────────────── */
.overview-banner {
    background: linear-gradient(135deg, rgba(0,102,255,0.06) 0%, rgba(59,130,246,0.03) 100%);
    border: 1px solid rgba(0,102,255,0.1);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.brain-huge-icon {
    font-size: 44px;
    color: var(--accent-primary);
    opacity: 0.6;
    animation: pulseBrain 3s infinite ease-in-out;
}
@keyframes pulseBrain {
    0%,100% { transform: scale(1); opacity: 0.6; }
    50%      { transform: scale(1.05); opacity: 0.85; }
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.card-header h3 {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 7px;
}

/* ── Tables ─────────────────────────────────────────────── */
.table-container { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255,255,255,0.01);
    white-space: nowrap;
}

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background-color: var(--bg-hover); }

.table-poster {
    width: 30px;
    height: 42px;
    object-fit: cover;
    border-radius: 4px;
    background-color: rgba(255,255,255,0.03);
}

.table-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* ── Badges ─────────────────────────────────────────────── */
.badge {
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: inline-block;
    white-space: nowrap;
}

.badge.series     { background-color: rgba(0,102,255,0.1);   color: var(--accent-blue);    }
.badge.movie      { background-color: rgba(0,102,255,0.1);   color: var(--accent-primary); }
.badge.public, .badge.active-pub { background-color: rgba(16,185,129,0.1);  color: var(--accent-green);  }
.badge.private    { background-color: rgba(245,158,11,0.1);  color: var(--accent-orange);  }
.badge.draft      { background-color: rgba(245,158,11,0.1);  color: var(--accent-orange);  }
.badge.archive    { background-color: rgba(255,255,255,0.04);color: var(--text-muted);     }

.rating-badge {
    background-color: rgba(245,158,11,0.08);
    color: var(--accent-orange);
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

/* ── Filter Bar ─────────────────────────────────────────── */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
    flex-wrap: wrap;
}

.search-box {
    display: inline-flex;
    align-items: center;
    background-color: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 5px 11px;
    gap: 7px;
    min-width: 220px;
    transition: border-color 0.18s ease;
}
.search-box:focus-within { border-color: var(--accent-primary); }

.search-icon {
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
}

.search-input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    padding: 0 !important;
    color: var(--text-main) !important;
    font-size: 13px !important;
    width: 100% !important;
}

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

.filter-select {
    background-color: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.18s ease;
}
.filter-select:focus { border-color: var(--accent-primary); }

/* ── AI Recommendation Styles ───────────────────────────── */
.ai-lists-container  { display: flex; flex-direction: column; gap: 16px; }

.ai-list-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px;
}

.ai-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.ai-list-title h3    { font-size: 15px; font-weight: 700; }
.ai-list-title p     { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.ai-list-controls    { display: flex; align-items: center; gap: 14px; }
.ai-active-lists-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 10px; }

/* Switch */
.switch-group { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer;
    inset: 0;
    background-color: rgba(255,255,255,0.08);
    transition: .28s; border-radius: 20px;
}
.slider:before {
    position: absolute; content: "";
    height: 14px; width: 14px;
    left: 3px; bottom: 3px;
    background-color: var(--text-main);
    transition: .28s; border-radius: 50%;
}
input:checked + .slider            { background-color: var(--accent-primary); }
input:checked + .slider:before     { transform: translateX(16px); }

/* AI Poster Row */
.ai-list-movies {
    display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px;
}
.ai-list-movies::-webkit-scrollbar { height: 4px; }
.ai-list-movies::-webkit-scrollbar-track { background: rgba(255,255,255,0.01); border-radius: 4px; }
.ai-list-movies::-webkit-scrollbar-thumb { background: rgba(0,102,255,0.2); border-radius: 4px; }
.ai-list-movies::-webkit-scrollbar-thumb:hover { background: rgba(0,102,255,0.45); }

.ai-movie-item    { width: 80px; flex-shrink: 0; text-align: center; }
.ai-movie-poster  { width: 80px; height: 114px; object-fit: cover; border-radius: 6px; margin-bottom: 4px; border: 1px solid rgba(255,255,255,0.05); }
.ai-movie-title   { font-size: 10.5px; font-weight: 500; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* AI Editor Items */
.ai-editor-items-list {
    background-color: rgba(255,255,255,0.015);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 210px;
    overflow-y: auto;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ai-editor-item-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 10px; border-radius: 6px;
    transition: background-color 0.18s ease; cursor: pointer;
}
.ai-editor-item-row:hover          { background-color: var(--bg-hover); }
.ai-editor-item-info               { display: flex; align-items: center; gap: 9px; }
.ai-editor-item-poster             { width: 22px; height: 32px; object-fit: cover; border-radius: 3px; }
.ai-editor-item-title              { font-size: 13px; font-weight: 600; color: var(--text-main); }
.ai-editor-item-meta               { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.ai-editor-item-checkbox           { width: 15px !important; height: 15px !important; cursor: pointer; accent-color: var(--accent-primary); }

/* ── Modals ─────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    inset: 0;
    background-color: rgba(0,0,0,0.72);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}
.modal.active { display: flex; }

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,0.55);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.modal-header h3 { font-size: 14.5px; font-weight: 700; }

.close-modal { font-size: 18px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.close-modal:hover { color: var(--text-main); }

.modal-body {
    padding: 14px 18px;
    overflow-y: auto;
    flex-grow: 1;
}
.modal-body::-webkit-scrollbar         { width: 4px; }
.modal-body::-webkit-scrollbar-track   { background: transparent; }
.modal-body::-webkit-scrollbar-thumb   { background: rgba(255,255,255,0.07); border-radius: 4px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 18px 14px 18px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    background-color: rgba(255,255,255,0.008);
}

/* Content Modal override */
#content-modal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    border-radius: var(--radius-md);
}
#content-modal .modal-body {
    padding: 14px 18px 18px 18px;
}
#content-modal .form-group        { margin-bottom: 8px; }
#content-modal .form-group label  { font-size: 11px; font-weight: 600; margin-bottom: 3px; color: var(--text-muted); }
#content-modal input[type="text"],
#content-modal input[type="number"],
#content-modal input[type="date"],
#content-modal select,
#content-modal textarea {
    padding: 6px 10px; font-size: 12.5px;
    border-radius: var(--radius-sm);
    background-color: rgba(255,255,255,0.015);
    border: 1px solid var(--border-color);
    height: 34px; color: var(--text-main); outline: none;
    width: 100%; transition: border-color 0.18s ease;
}
#content-modal input:focus,
#content-modal select:focus,
#content-modal textarea:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--border-focus); }
#content-modal textarea { height: 58px; resize: none; }

/* Credit + Multilang Modals */
#credit-modal .modal-content,
#multilang-modal .modal-content { max-width: 430px; max-height: 85vh; border-radius: var(--radius-md); }

#credit-modal .modal-body,
#multilang-modal .modal-body    { padding: 12px 18px 18px 18px; }

#credit-modal .form-group,
#multilang-modal .form-group    { margin-bottom: 10px; }

#credit-modal .form-group label,
#multilang-modal .form-group label { font-size: 11px; font-weight: 600; margin-bottom: 3px; color: var(--text-muted); }

#credit-modal input[type="text"],
#credit-modal input[type="url"],
#credit-modal input[type="date"],
#multilang-modal input[type="text"] {
    height: 34px; padding: 6px 10px; font-size: 12.5px;
    border-radius: var(--radius-sm);
    background-color: rgba(255,255,255,0.015);
    border: 1px solid var(--border-color);
    color: var(--text-main); width: 100%; outline: none;
    transition: border-color 0.18s ease;
}
#credit-modal input:focus,
#multilang-modal input:focus    { border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--border-focus); }

#credit-modal textarea,
#multilang-modal textarea       { height: 60px; resize: none; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group            { margin-bottom: 12px; }
.form-row              { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-group label {
    display: block; font-size: 12px; font-weight: 600;
    margin-bottom: 5px; color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%; padding: 8px 12px;
    background-color: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px; font-size: 13px;
    outline: none; transition: border-color 0.18s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--border-focus);
}

/* Input + button row */
.input-upload-group          { display: flex; gap: 7px; }
.input-upload-group input    { flex-grow: 1; }
.input-upload-group button   { flex-shrink: 0; height: 34px; padding: 0 11px; font-size: 12px; }

/* Content Form Grid */
.form-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 8px;
}
.form-grid-column     { display: flex; flex-direction: column; gap: 8px; }
.form-grid-column .form-group { margin-bottom: 0; }
.form-row-grid        { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.form-section-title {
    font-size: 12px; font-weight: 700;
    color: var(--accent-primary);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 4px; margin-top: 4px; margin-bottom: 2px;
    display: flex; align-items: center; gap: 5px;
}

.form-section-card {
    background-color: rgba(255,255,255,0.012);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
}

/* Title + Fetch buttons */
.title-section-group {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: rgba(255,255,255,0.01);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.fetch-buttons-group           { display: flex; gap: 7px; margin-bottom: 2px; }
.fetch-buttons-group button    { white-space: nowrap; padding: 0 10px; font-size: 11px; font-weight: 600; height: 32px; display: inline-flex; align-items: center; gap: 5px; border-radius: var(--radius-sm); cursor: pointer; }

/* ── Multi-lang group ───────────────────────────────────── */
.multilang-group {
    display: flex; width: 100%; align-items: stretch;
    background-color: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px; overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.multilang-group:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--border-focus);
}
.multilang-group input,
.multilang-group textarea {
    flex: 1; margin-bottom: 0 !important; border: none !important;
    background: transparent !important; box-shadow: none !important;
    border-radius: 0 !important; padding: 7px 11px;
    color: var(--text-main); font-size: 13px; outline: none !important;
}
.btn-multilang {
    background: transparent !important; border: none !important;
    border-left: 1px solid var(--border-color) !important;
    color: var(--text-muted) !important; border-radius: 0 !important;
    width: 40px; min-width: 40px; cursor: pointer;
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; padding: 0 !important;
}
.btn-multilang:hover {
    color: var(--accent-primary) !important;
    background: rgba(0,102,255,0.07) !important;
}

/* ── Lookup Multi-Select ────────────────────────────────── */
.lookup-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lookup-selected-pills {
    display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 0;
}
.lookup-pill {
    display: inline-flex; align-items: center; gap: 5px;
    background-color: rgba(0,102,255,0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(0,102,255,0.18);
    padding: 2px 8px; font-size: 11px; font-weight: 600; border-radius: 4px;
}
.lookup-pill-remove {
    cursor: pointer; font-size: 12px;
    color: var(--accent-primary); opacity: 0.65;
    transition: opacity 0.15s ease;
}
.lookup-pill-remove:hover { opacity: 1; }
.lookup-search-box { 
    width: 100% !important; 
    padding: 6px 12px !important; 
    display: flex; 
    flex-wrap: wrap; 
    align-items: center; 
    gap: 6px; 
}
.lookup-search-box .search-icon {
    margin-top: 0;
}
.lookup-search-box .search-input {
    flex: 1; min-width: 150px; padding: 2px 0 !important; border: none !important; background: transparent !important;
}
.lookup-search-box .search-input:focus { box-shadow: none !important; }
.lookup-dropdown {
    display: none; position: absolute;
    top: 100%; left: 0; right: 0;
    background-color: #0e1420;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.55);
    max-height: 155px; overflow-y: auto;
    z-index: 150; margin-top: 4px;
}
.lookup-dropdown.active    { display: block; }
.lookup-dropdown-item {
    padding: 7px 14px; font-size: 12.5px;
    color: var(--text-main); cursor: pointer;
    transition: background-color 0.15s ease;
}
.lookup-dropdown-item:hover { background-color: rgba(255,255,255,0.04); }

/* ── Language Tabs ──────────────────────────────────────── */
.lang-tabs-wrapper {
    display: flex; justify-content: space-between; align-items: center;
    background-color: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    padding: 7px 14px; border-radius: 8px; margin-bottom: 14px;
}
.lang-tabs-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.lang-tabs       { display: flex; gap: 4px; }
.lang-tab {
    background-color: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 3px 9px; font-size: 11px; font-weight: 700;
    border-radius: 4px; cursor: pointer; transition: var(--transition);
}
.lang-tab:hover  { color: var(--text-main); }
.lang-tab.active { background-color: var(--accent-primary); color: #fff; border-color: var(--accent-primary); }

/* ── Section Titles ─────────────────────────────────────── */
.section-title-wrapper  { margin-bottom: 10px; }
.panel-section-title    { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.panel-section-subtitle { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

.text-success { color: var(--accent-green); }
.text-purple  { color: var(--accent-primary); }

/* ── Dashboard Grid ─────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 4px;
}

@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* ── Utility ────────────────────────────────────────────── */
.hidden  { display: none !important; }
.mt-4    { margin-top: 4px; }
.mt-8    { margin-top: 8px; }
.mt-12   { margin-top: 12px; }
.mb-12   { margin-bottom: 12px; }

/* ── Scrollbar Global ───────────────────────────────────── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.13); }

/* ── Parametric Grid ────────────────────────────────────── */
.parametric-layout {
    display: flex;
    gap: 20px;
    height: calc(100vh - 40px); /* Fill available space */
}

.parametric-sidebar {
    width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-right: 1px solid var(--border-color);
    padding-right: 16px;
}

.p-tab {
    padding: 12px 14px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.p-tab:hover {
    border-color: rgba(255,255,255,0.1);
    color: var(--text-main);
}

.p-tab.active {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.parametric-content {
    flex: 1;
    overflow-y: auto;
}

.p-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.p-pane.active {
    display: block;
}

.p-card {
    margin: 0;
    height: 100%;
}

@media (max-width: 1024px) { 
    .parametric-layout { flex-direction: column; height: auto; } 
    .parametric-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); padding-right: 0; padding-bottom: 16px; }
}

/* ── Settings ───────────────────────────────────────────── */
.settings-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 20px; margin-top: 10px;
}
@media (max-width: 900px) { .settings-grid, .form-grid-layout { grid-template-columns: 1fr; } }

.settings-info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--border-color);
}
.settings-info-row:last-child { border-bottom: none; }
.info-label  { color: var(--text-muted); font-weight: 500; font-size: 13px; }
.info-value  { color: var(--text-main);  font-weight: 600; font-size: 13px; }
.settings-actions { margin-top: 16px; display: flex; justify-content: flex-end; }

/* ── Bulk Actions ───────────────────────────────────────── */
.bulk-actions-panel {
    display: none;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-card);
    border: 1px solid rgba(0,102,255,0.25);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 10px;
    gap: 12px;
    animation: slideDown 0.22s ease-out;
}
@keyframes slideDown {
    from { transform: translateY(-8px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.bulk-actions-info       { font-size: 13px; font-weight: 500; color: var(--text-main); }
.bulk-actions-info span  { color: var(--accent-primary); font-weight: 700; }
.bulk-actions-buttons    { display: flex; gap: 8px; flex-wrap: wrap; }

.select-row-checkbox {
    width: 15px; height: 15px;
    accent-color: var(--accent-primary); cursor: pointer;
}

/* ── AI Progress Widget ─────────────────────────────────── */
.ai-progress-widget {
    position: fixed; bottom: 18px; left: 18px;
    background: var(--bg-card);
    border: 1px solid rgba(0,102,255,0.28);
    border-radius: 12px; padding: 14px;
    width: 310px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.45);
    z-index: 9999;
    display: flex; flex-direction: column; gap: 7px;
    color: var(--text-main); font-size: 13px;
    animation: slideUp 0.25s ease-out;
}
@keyframes slideUp {
    from { transform: translateY(10px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.ai-progress-bar-container {
    width: 100%; height: 5px;
    background: rgba(255,255,255,0.05);
    border-radius: 3px; overflow: hidden;
}
.ai-progress-bar-fill {
    height: 100%; width: 0%;
    background: var(--accent-primary);
    border-radius: 3px; transition: width 0.35s ease;
}

/* ── Toast ──────────────────────────────────────────────── */
.movi-toast {
    background: var(--bg-card);
    border-radius: 8px; padding: 11px 16px;
    color: var(--text-main);
    box-shadow: 0 5px 22px rgba(0,0,0,0.4);
    display: flex; align-items: center; gap: 10px;
    min-width: 270px; max-width: 380px;
    pointer-events: auto;
    animation: toastIn 0.25s ease-out forwards;
    font-size: 13px;
    border-left: 3px solid var(--accent-primary);
}
.movi-toast.success { border-left-color: var(--accent-green); }
.movi-toast.error   { border-left-color: var(--accent-red);   }

@keyframes toastIn  { from { transform: translateX(48px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; }    to { transform: translateX(48px); opacity: 0; } }

/* ── Login Screen ───────────────────────────────────────── */
.login-overlay {
    position: fixed; inset: 0;
    background: radial-gradient(ellipse at 50% 30%, #071330 0%, #030712 65%);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
}

.login-card {
    background-color: var(--bg-card);
    padding: 38px 36px;
    border-radius: 16px;
    border: 1px solid rgba(0,102,255,0.15);
    width: 100%; max-width: 410px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
    text-align: center;
}

.login-brand {
    font-size: 36px; font-weight: 900;
    margin-bottom: 22px; letter-spacing: 1px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.login-brand i { color: var(--accent-primary); -webkit-text-fill-color: initial; }

.login-card h3 {
    color: var(--text-main); font-size: 16px;
    font-weight: 600; margin-bottom: 22px; letter-spacing: 0.3px;
}

.login-error {
    background-color: rgba(239,68,68,0.08);
    color: var(--accent-red);
    border: 1px solid rgba(239,68,68,0.18);
    border-radius: 8px; padding: 10px 12px;
    margin-bottom: 16px; font-size: 13px;
    display: none; text-align: left;
}

.login-input-group { text-align: left; margin-bottom: 16px; }

.login-input-group label {
    color: var(--text-muted); font-size: 12.5px;
    font-weight: 500; display: block; margin-bottom: 7px;
}

.login-input {
    width: 100%; height: 44px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background-color: rgba(255,255,255,0.03);
    color: var(--text-main); padding: 0 14px;
    font-size: 14px; transition: var(--transition);
}
.login-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background-color: rgba(0,102,255,0.04);
    box-shadow: 0 0 0 2px var(--border-focus);
}

.login-btn {
    width: 100%; height: 46px; border: none;
    border-radius: 8px;
    background: var(--accent-primary);
    color: #fff; font-weight: 700;
    cursor: pointer; font-size: 15px;
    transition: var(--transition);
}
.login-btn:hover {
    background: #0052cc;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,102,255,0.3);
}
.login-btn:active { transform: translateY(0); box-shadow: none; }

/* ── Content Edit Layout & Form ──────────────── */
.content-edit-layout {
    display: flex;
    gap: 0;
    align-items: flex-start;
}
.content-edit-form-side {
    flex: 1;
    width: 100%;
}

/* Header Actions */
.form-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 20px;
}
.form-header-title-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 4px 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-header-title-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--border-focus);
}
.massive-title-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    padding: 12px;
    font-family: 'Outfit', sans-serif;
}
.massive-title-input::placeholder { color: rgba(255,255,255,0.2); }
.title-lang-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    padding: 12px;
    cursor: pointer;
    transition: color 0.2s;
}
.title-lang-btn:hover { color: var(--accent-primary); }

.form-header-buttons {
    display: flex;
    gap: 10px;
    padding-top: 6px;
}
.form-header-buttons button {
    height: 48px;
    padding: 0 20px;
    font-size: 14px;
    border-radius: 10px;
}

/* ── Trailer Grid ──────────────────────────────────────── */
.trailer-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.trailer-row .input-upload-group {
    margin: 0;
    flex: 1;
}

@media (max-width: 1100px) {
    .content-edit-layout { flex-direction: column; }
    .content-edit-form-side { flex: none; width: 100%; }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    body { overflow-y: auto; }

    .app-container {
        flex-direction: column; height: auto;
        min-height: 100vh; overflow: visible;
    }

    .sidebar {
        width: 100%; min-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 12px 14px;
        flex-direction: column; gap: 10px;
        position: sticky; top: 0; z-index: 999;
    }

    .brand { margin-bottom: 0; padding-bottom: 10px; }

    .nav-menu {
        flex-direction: row; overflow-x: auto;
        width: 100%; gap: 6px; padding-bottom: 4px;
        white-space: nowrap; scrollbar-width: none;
    }
    .nav-menu::-webkit-scrollbar { display: none; }
    .nav-section-title { display: none; }

    .nav-item {
        padding: 7px 11px; font-size: 12.5px;
        border-left: none; border-bottom: 2px solid transparent;
        border-radius: var(--radius-sm);
    }
    .nav-item.active {
        border-left: none;
        border-bottom: 2px solid var(--accent-primary);
        background-color: rgba(0,102,255,0.08);
        border-radius: var(--radius-sm);
    }

    .sidebar-footer {
        flex-direction: row; align-items: center;
        justify-content: space-between;
        padding-top: 8px; margin-top: 4px;
        border-top: 1px solid var(--border-color); width: 100%;
    }

    .main-content { padding: 14px 14px 80px 14px; overflow: visible; height: auto; }

    .main-header {
        flex-direction: column; align-items: flex-start; gap: 10px;
    }
    .header-actions { width: 100%; display: flex; gap: 8px; flex-wrap: wrap; }
    .header-actions .btn { flex-grow: 1; justify-content: center; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card  { padding: 11px 12px; gap: 10px; }
    .stat-icon  { width: 34px; height: 34px; font-size: 13px; }
    .stat-value { font-size: 18px; }
    .stat-label { font-size: 11px; }

    .data-table th, .data-table td { padding: 7px 10px; font-size: 12px; }

    .modal-content { width: calc(100% - 20px) !important; max-height: 90vh; }
    .modal-footer { flex-direction: column-reverse; gap: 7px; }
    .modal-footer .btn { width: 100%; justify-content: center; }

    .form-grid-layout { grid-template-columns: 1fr; }
    .parametric-grid  { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}
