/* FilmsMX Admin Panel - Modern White / Light Theme & Responsive CSS */
:root {
    --admin-bg: #f8fafc;
    --admin-sidebar: #ffffff;
    --admin-card: #ffffff;
    --admin-border: #e2e8f0;
    --admin-border-light: #f1f5f9;
    --admin-primary: #0284c7;
    --admin-primary-hover: #0369a1;
    --admin-success: #10b981;
    --admin-danger: #ef4444;
    --admin-warning: #f59e0b;
    --admin-purple: #8b5cf6;
    --admin-text: #0f172a;
    --admin-text-muted: #64748b;
    --admin-text-light: #94a3b8;
    --admin-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
    --admin-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
}

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

body {
    background: var(--admin-bg);
    color: var(--admin-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--admin-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--admin-primary-hover);
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Overlay on Mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* Sidebar - Clean White */
.admin-sidebar {
    width: 260px;
    background: var(--admin-sidebar);
    border-right: 1px solid var(--admin-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 999;
    transition: transform 0.25s ease-in-out;
}

.admin-brand {
    padding: 18px 20px;
    font-size: 19px;
    font-weight: 800;
    color: #0f172a;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.admin-brand a {
    color: #0f172a !important;
}

.admin-brand span {
    color: var(--admin-primary);
    background: #e0f2fe;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 4px;
    font-weight: 700;
}

.admin-nav {
    list-style: none;
    padding: 12px 0;
    flex: 1;
    overflow-y: auto;
}

.admin-nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--admin-text-muted);
    font-weight: 600;
    font-size: 13.5px;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.admin-nav-item a i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.admin-nav-item a:hover {
    color: var(--admin-primary);
    background: #f1f5f9;
}

.admin-nav-item.active a {
    color: var(--admin-primary);
    background: #e0f2fe;
    border-left: 3px solid var(--admin-primary);
    font-weight: 700;
}

.admin-nav-item.logout a {
    color: var(--admin-danger);
    margin-top: 10px;
    border-top: 1px solid var(--admin-border-light);
    padding-top: 14px;
}
.admin-nav-item.logout a:hover {
    background: #fee2e2;
}

/* Content Area */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--admin-bg);
}

.admin-topbar {
    background: var(--admin-sidebar);
    border-bottom: 1px solid var(--admin-border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--admin-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 12px;
}

.admin-menu-toggle {
    display: none;
    background: #f1f5f9;
    border: 1px solid var(--admin-border);
    color: var(--admin-text);
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}
.admin-menu-toggle:hover {
    background: #e2e8f0;
}

.admin-content {
    padding: 24px;
    flex: 1;
    max-width: 100%;
}

.page-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Cards & Widgets */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: var(--admin-shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
    box-shadow: var(--admin-shadow-md);
    transform: translateY(-2px);
}

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

.stat-info h3 {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

.stat-info p {
    font-size: 13px;
    color: var(--admin-text-muted);
    margin: 2px 0 0 0;
    font-weight: 500;
}

.admin-card, .table-card, .settings-card {
    background: var(--admin-card) !important;
    border: 1px solid var(--admin-border) !important;
    border-radius: 10px !important;
    padding: 22px !important;
    margin-bottom: 24px !important;
    box-shadow: var(--admin-shadow) !important;
    overflow-x: auto;
}

.admin-card-header, .settings-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a !important;
    margin-top: 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--admin-border-light);
    padding-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Tables */
.admin-table, .table-card table, table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.admin-table th, .table-card th, table th {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
    background: #f8fafc !important;
    color: var(--admin-text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table td, .table-card td, table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border-light);
    color: #1e293b;
    vertical-align: middle;
}

.admin-table tr:hover, .table-card tbody tr:hover, table tbody tr:hover {
    background: #f8fafc;
}

.table-thumb {
    width: 44px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--admin-border);
    display: block;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
}
.badge-blue { background: #e0f2fe; color: #0369a1; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-amber, .badge-warning { background: #fef3c7; color: #b45309; }
.badge-red { background: #fee2e2; color: #b91c1c; }

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

.form-label, label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1e293b;
    font-size: 13.5px;
}

.form-control, select.form-control, textarea.form-control, input[type="text"].form-control, input[type="password"].form-control {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    color: #0f172a !important;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--admin-primary) !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

textarea.form-control {
    min-height: 90px;
    font-family: inherit;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 13.5px;
    transition: all 0.15s ease;
    gap: 6px;
    text-decoration: none !important;
    white-space: nowrap;
}

.btn-primary {
    background: var(--admin-primary);
    color: #ffffff !important;
}
.btn-primary:hover {
    background: var(--admin-primary-hover);
    color: #ffffff !important;
}

.btn-secondary {
    background: #e2e8f0;
    color: #334155 !important;
}
.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-outline {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155 !important;
}
.btn-outline:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-success {
    background: var(--admin-success);
    color: #ffffff !important;
}
.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--admin-danger);
    color: #ffffff !important;
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: #000000 !important;
}
.btn-warning:hover {
    background: #d97706;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Responsive Grid Form Layouts */
.form-layout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.dynamic-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr 1fr auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    background: #f8fafc;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--admin-border);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 13.5px;
}
.alert-success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}
.alert-danger {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* Pagination */
.pagination-wrap {
    display: flex;
    gap: 6px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    color: var(--admin-text);
    font-weight: 600;
    font-size: 13px;
    transition: all 0.15s ease;
}
.page-link:hover, .page-link.active {
    background: var(--admin-primary);
    color: #ffffff;
    border-color: var(--admin-primary);
}

/* ========================================================
   MOBILE RESPONSIVENESS (Admin Panel)
   ======================================================== */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .form-layout-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    .admin-menu-toggle {
        display: inline-flex !important;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 270px;
        transform: translateX(-100%);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    }
    .admin-sidebar.sidebar-open {
        transform: translateX(0);
    }

    .admin-content {
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .dynamic-row {
        grid-template-columns: 1fr !important;
        gap: 6px;
    }

    .page-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .admin-card, .table-card, .settings-card {
        padding: 15px !important;
    }

    .admin-topbar {
        padding: 10px 15px;
    }
}
