/* Admin Dashboard Styles */

:root {
    --primary: #e50914;
    --secondary: #221f1f;
    --accent: #f5b041;
    --light: #f8f9fa;
    --dark: #0f0f0f;
    --text: #ffffff;
    --text-secondary: #b3b3b3;
    --border: #333333;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 250px;
    background: linear-gradient(135deg, var(--secondary) 0%, #1a1817 100%);
    padding: 2rem 0;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    border-right: 1px solid var(--border);
}

.sidebar-header {
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    color: var(--primary);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(229, 9, 20, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 250px;
    background: var(--dark);
}

.top-nav {
    background: linear-gradient(135deg, var(--secondary) 0%, #1a1817 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-left h1 {
    font-size: 1.8rem;
}

.toggle-sidebar {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
    display: none;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

.dashboard-content {
    padding: 2rem;
    max-width: 1440px;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #242424 0%, #171717 100%);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    min-height: 108px;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(229, 9, 20, 0.2);
}

.stat-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary) 0%, #ff073a 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex: 0 0 52px;
}

.stat-icon-success {
    background: linear-gradient(135deg, var(--success) 0%, #1f8f4f 100%);
}

.stat-icon-info {
    background: linear-gradient(135deg, var(--info) 0%, #216fa3 100%);
}

.stat-icon-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #c47c0a 100%);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

/* ===== CHARTS GRID ===== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: linear-gradient(135deg, #242424 0%, #171717 100%);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
}

.chart-card h3 {
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 1.05rem;
}

.chart-placeholder {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    height: 320px;
    position: relative;
}

/* ===== TABLE ===== */
.recent-content,
.table-container {
    background: linear-gradient(135deg, #242424 0%, #171717 100%);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.recent-content h3 {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
}

.table-container {
    overflow-x: auto;
}

.content-table {
    width: 100%;
    border-collapse: collapse;
}

.content-table thead {
    background: rgba(229, 9, 20, 0.1);
}

.content-table th {
    padding: 0.9rem 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.content-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.content-table tbody tr:hover {
    background: rgba(229, 9, 20, 0.05);
}

.table-title {
    color: var(--text);
    font-weight: 700;
    line-height: 1.25;
}

.table-subtitle {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.table-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem !important;
}

.rating-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--accent);
    font-weight: 700;
}

.content-table .btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    border-radius: 6px;
}

/* ===== BADGES ===== */
.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-film {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.badge-series {
    background: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
}

.badge-anime {
    background: rgba(244, 208, 63, 0.2);
    color: #f4d03f;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
}

.status-badge.inactive {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #ff073a 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-edit {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border: 1px solid #3498db;
}

.btn-delete {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

/* ===== FILTER BAR ===== */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input,
.filter-select {
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    font-size: 1rem;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.filter-select {
    min-width: 150px;
    cursor: pointer;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(229, 9, 20, 0.1);
}

/* ===== FORM ===== */
.form-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.form-card {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
}

.form-card h2 {
    margin-bottom: 2rem;
    color: var(--primary);
    font-size: 1.5rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text);
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(229, 9, 20, 0.1);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.input-group {
    display: flex;
    gap: 1rem;
}

.input-group .form-control {
    flex: 1;
}

.input-group .btn {
    flex-shrink: 0;
}

small {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.form-actions .btn {
    flex: 1;
    justify-content: center;
    min-width: 150px;
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--primary);
    font-size: 1.2rem;
}

.loading-spinner i {
    margin-right: 0.5rem;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.page-btn {
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.page-btn:hover,
.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 0;
        position: fixed;
        z-index: 1000;
        transition: all 0.3s ease;
    }

    .sidebar.active {
        width: 250px;
    }

    .main-content {
        margin-left: 0;
    }

    .toggle-sidebar {
        display: block;
    }

    .top-nav {
        flex-wrap: wrap;
    }

    .nav-left h1 {
        font-size: 1.3rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .content-table {
        font-size: 0.85rem;
    }

    .content-table th,
    .content-table td {
        padding: 0.7rem;
    }

    .filter-bar {
        flex-direction: column;
    }

    .search-input {
        min-width: auto;
    }

    .filter-select {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .content-table {
        display: block;
        overflow-x: auto;
    }
}

/* ===== SEARCH TABS ===== */
.search-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}

/* ===== TMDb RESULTS ===== */
.tmdb-results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.tmdb-result-card {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tmdb-result-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(229, 9, 20, 0.2);
    transform: translateY(-5px);
}

.result-poster {
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.result-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tmdb-result-card:hover .result-poster img {
    transform: scale(1.05);
}

.result-info {
    padding: 1rem;
}

.result-info h4 {
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.result-info p strong {
    color: var(--text);
}

.result-info button {
    width: 100%;
    margin-top: 0.5rem;
}

