@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

:root {
    --bg-color: #090A0F;
    --surface-color: #121520;
    --surface-light: #1D2235;
    --accent-red: #E50914;
    --accent-glow: rgba(229, 9, 20, 0.4);
    --accent-purple: #8E2DE2;
    --text-primary: #FFFFFF;
    --text-secondary: #9FA6B5;
    --border-color: rgba(255, 255, 255, 0.08);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

.d-none {
    display: none !important;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

/* ──────────────────────────────────────────────────────────────────────────────────
   1. LOGIN PORTAL STYLE (Passcode Grid Dialer)
   ────────────────────────────────────────────────────────────────────────────────── */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at center, #1B1E2E 0%, #090A0F 100%);
    padding: 20px;
}

.login-card {
    background: rgba(18, 21, 32, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 100%;
    max-width: 360px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.login-logo {
    display: inline-flex;
    padding: 10px 18px;
    background: linear-gradient(135deg, #FF1744, #B71C1C);
    border-radius: 12px;
    font-weight: 900;
    font-style: italic;
    font-size: 24px;
    letter-spacing: -2px;
    box-shadow: 0 4px 15px var(--accent-glow);
    margin-bottom: 12px;
}

.login-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Dots display */
.dots-display {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 35px;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.dot.active {
    background: var(--accent-red);
    box-shadow: 0 0 10px var(--accent-red);
    border-color: var(--accent-red);
}

/* Dialer grid */
.dialer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    max-width: 260px;
    margin: 0 auto;
}

.dial-btn {
    background: var(--surface-light);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 700;
    height: 60px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.dial-btn:active {
    transform: scale(0.92);
    background: var(--accent-red);
    box-shadow: 0 0 12px var(--accent-red);
}

.dial-btn.action-btn {
    background: rgba(229, 9, 20, 0.15);
    color: #FF5252;
    border-color: rgba(229, 9, 20, 0.3);
}

.dial-btn.action-btn:active {
    background: var(--accent-red);
    color: white;
}

/* ──────────────────────────────────────────────────────────────────────────────────
   2. MAIN APPLICATION WORKSPACE
   ────────────────────────────────────────────────────────────────────────────────── */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 250px;
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    padding: 6px 12px;
    background: linear-gradient(135deg, #FF1744, #B71C1C);
    border-radius: 8px;
    font-weight: 900;
    font-style: italic;
    font-size: 16px;
    letter-spacing: -1.5px;
    box-shadow: 0 3px 10px var(--accent-glow);
}

.sidebar-title {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.nav-menu {
    list-style: none;
    padding: 20px 12px;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    transition: all 0.2s ease;
}

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

.nav-item.active {
    background: linear-gradient(90deg, rgba(229, 9, 20, 0.15) 0%, rgba(142, 45, 226, 0.05) 100%);
    color: var(--text-primary);
    border-left: 3px solid var(--accent-red);
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #FF5252;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.3);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.top-bar {
    height: 70px;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-light);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00E676;
    box-shadow: 0 0 8px #00E676;
}

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

/* ──────────────────────────────────────────────────────────────────────────────────
   3. DASHBOARD METRICS CARDS & PANELS
   ────────────────────────────────────────────────────────────────────────────────── */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-purple));
}

.metric-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.metric-val {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.metric-highlight {
    color: #00E676;
    font-weight: 600;
}

/* ──────────────────────────────────────────────────────────────────────────────────
   4. DATA TABLES, CONTROL BARS & CARDS
   ────────────────────────────────────────────────────────────────────────────────── */
.control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    max-width: 350px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.15);
}

.action-row-buttons {
    display: flex;
    gap: 10px;
}

.btn-primary {
    background: var(--accent-red);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.25);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.4);
}

.btn-secondary {
    background: var(--surface-light);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
    background: rgba(255, 82, 82, 0.15);
    color: #FF5252;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid rgba(255, 82, 82, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #FF5252;
    color: white;
    border-color: #FF5252;
}

/* Modern Card Layout */
.data-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 18px;
}

.data-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 2 / 3;
    transition: all 0.25s ease;
}

.data-card:hover {
    transform: translateY(-5px);
    border-color: rgba(229, 9, 20, 0.4);
    box-shadow: 0 10px 25px rgba(229, 9, 20, 0.15);
}

.card-poster-only {
    width: 100%;
    height: 100%;
    position: relative;
    background-size: cover;
    background-position: center;
    background-color: var(--surface-light);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.card-actions-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.data-card:hover .card-actions-overlay {
    opacity: 1;
}

.action-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(18, 21, 32, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.action-icon-btn:hover {
    background: var(--accent-red);
    color: white;
    transform: scale(1.1);
}

.action-icon-btn.btn-delete:hover {
    background: #FF5252;
}

.card-body {
    display: none; /* Removed separate body container */
}

.card-title-overlay {
    background: linear-gradient(to top, rgba(9, 10, 15, 0.95) 0%, rgba(9, 10, 15, 0.6) 70%, transparent 100%);
    padding: 24px 12px 14px 12px;
    width: 100%;
    z-index: 2;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(229, 9, 20, 0.2);
    color: #FF5252;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

/* User management Table list */
.table-panel {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
}

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

.custom-table th {
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.user-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-purple);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: white;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(0, 230, 118, 0.15);
    color: #00E676;
}

.status-badge.inactive {
    background: rgba(255, 82, 82, 0.15);
    color: #FF5252;
}

/* ──────────────────────────────────────────────────────────────────────────────────
   5. COMPACT MODALS & PREMIUM FORMS
   ────────────────────────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 10, 15, 0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
}

.modal-close {
    cursor: pointer;
    font-size: 20px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--accent-red);
}

.modal-body {
    padding: 24px;
}

/* Forms UI */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

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

/* Taxonomy Multi-select items grid */
.taxonomy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    background: var(--bg-color);
}

.taxonomy-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}

.taxonomy-item input {
    accent-color: var(--accent-red);
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ──────────────────────────────────────────────────────────────────────────────────
   6. MISCELLANEOUS COMPACT WIDGETS
   ────────────────────────────────────────────────────────────────────────────────── */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--surface-light);
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-red);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Settings configurations panel */
.settings-wrapper {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 24px;
}

.settings-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.settings-group:last-child {
    border-bottom: none;
}

.settings-info {
    max-width: 80%;
}

.settings-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.settings-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Hidden items utility class */
.d-none {
    display: none !important;
}

/* Seasons and episodes layout lists */
.season-collapsible {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 10px;
    background: var(--surface-color);
    overflow: hidden;
}

.season-header {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
}

.season-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.season-body {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.episode-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.episode-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.episode-thumbnail {
    width: 50px;
    height: 30px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    background-color: var(--surface-light);
}

.episode-name {
    font-size: 13px;
    font-weight: 500;
}
