/* XterdaZ Admin Panel Styles */
:root {
    --primary-green: #2d5016;
    --secondary-green: #4ade80;
    --accent-green: #16a34a;
    --light-green: #dcfce7;
    --dark-green: #14532d;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-400: #a3a3a3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;
    --white: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-md: rgba(0, 0, 0, 0.15);
    --shadow-lg: rgba(0, 0, 0, 0.25);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
    background: linear-gradient(135deg,
            var(--primary-green) 0%,
            var(--secondary-green) 100%);
    min-height: 100vh;
    color: var(--neutral-700);
    line-height: 1.5;
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    /* background: var(--white); */
    box-shadow: 2px 0 10px var(--shadow);
    transition: transform 0.3s ease;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    /* overflow-y: auto; */
}

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

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

.logo-text {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg,
            var(--primary-green),
            var(--secondary-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-badge {
    background: var(--accent-green);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--neutral-500);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    display: none;
}

.sidebar-toggle:hover {
    background: var(--neutral-100);
}

.nav-menu {
    padding: 24px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    color: var(--neutral-600);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--light-green);
    color: var(--accent-green);
}

.nav-item.active {
    background: var(--light-green);
    color: var(--accent-green);
    border-left-color: var(--accent-green);
    font-weight: 600;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--neutral-100);
}

.content-header {
    background: var(--white);
    padding: 13px 32px;
    border-bottom: 1px solid var(--neutral-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px var(--shadow);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-toggle {
    background: none;
    border: none;
    color: var(--neutral-600);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    display: none;
}

.mobile-menu-toggle:hover {
    background: var(--neutral-100);
}

#pageTitle {
    font-size: 24px;
    font-weight: 600;
    /* color: var(--neutral-800); */
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.admin-profile:hover {
    background: var(--neutral-100);
    color: black;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-name {
    font-weight: 500;
    /* color: var(--neutral-700); */
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-md);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg,
            var(--primary-green),
            var(--secondary-green));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 24px;
}

.stat-info h3 {
    font-size: 14px;
    color: var(--neutral-500);
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--neutral-800);
    margin-bottom: 4px;
}

.stat-change {
    font-size: 12px;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--error);
}

/* Dashboard Charts */
.dashboard-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.chart-card,
.recent-activity {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow);
}

.chart-card h3,
.recent-activity h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--neutral-800);
    margin-bottom: 20px;
}

.chart-placeholder {
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--neutral-400);
    background: var(--neutral-100);
    border-radius: 8px;
}

.chart-placeholder i {
    font-size: 48px;
    margin-bottom: 16px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: var(--neutral-50);
}

.activity-icon {
    width: 36px;
    height: 36px;
    background: var(--light-green);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-green);
}

.activity-details p {
    font-weight: 500;
    color: var(--neutral-700);
    margin-bottom: 2px;
}

.activity-details span {
    font-size: 12px;
    color: var(--neutral-500);
}

/* Common Components */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-primary {
    background: var(--accent-green);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-green);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--neutral-200);
    color: var(--neutral-700);
}

.btn-secondary:hover {
    background: var(--neutral-300);
}

.btn-danger {
    background: var(--error);
    color: var(--white);
}

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

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--neutral-700);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--neutral-200);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    background: var(--white);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

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

.data-table {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--shadow);
}

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

.table-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--neutral-800);
}

.table-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    padding: 8px 16px;
    border: 1px solid var(--neutral-300);
    border-radius: 6px;
    font-size: 14px;
}

.table-wrapper {
    overflow-x: auto;
}

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

th,
td {
    padding: 12px 24px;
    text-align: left;
    border-bottom: 1px solid var(--neutral-200);
}

th {
    background: var(--neutral-50);
    font-weight: 600;
    color: var(--neutral-700);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr:hover {
    background: var(--neutral-50);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: var(--light-green);
    color: var(--success);
}

.status-inactive {
    background: #fee2e2;
    color: var(--error);
}

.status-pending {
    background: #fef3c7;
    color: var(--warning);
}

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

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

.modal {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 20px 25px var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--neutral-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--neutral-500);
    cursor: pointer;
    padding: 4px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .content-header {
        padding: 16px;
    }

    .content-area {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stat-card {
        padding: 20px;
    }

    .dashboard-charts {
        gap: 16px;
    }

    .chart-card,
    .recent-activity {
        padding: 20px;
    }

    .admin-profile .profile-name {
        display: none;
    }

    .table-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .table-controls {
        justify-content: stretch;
    }

    .search-input {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .content-header {
        padding: 12px;
    }

    .content-area {
        padding: 12px;
    }

    #pageTitle {
        font-size: 20px;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }

    .stat-info h3 {
        margin-top: 8px;
    }

    .modal {
        width: 95%;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-header {
        padding: 16px 16px 0;
    }

    .modal-footer {
        padding: 0 16px 16px;
        flex-direction: column;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--neutral-500);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--neutral-300);
    border-top: 2px solid var(--accent-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    z-index: 3000;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid var(--neutral-400);
}

.notification-success {
    border-left-color: var(--success);
}

.notification-error {
    border-left-color: var(--error);
}

.notification-warning {
    border-left-color: var(--warning);
}

.notification-info {
    border-left-color: var(--accent-green);
}

.notification i {
    font-size: 18px;
}

.notification-success i {
    color: var(--success);
}

.notification-error i {
    color: var(--error);
}

.notification-warning i {
    color: var(--warning);
}

.notification-info i {
    color: var(--accent-green);
}

.notification span {
    flex: 1;
    font-weight: 500;
    color: var(--neutral-700);
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--neutral-500);
    cursor: pointer;
    padding: 0;
}

.notification-close:hover {
    color: var(--neutral-700);
}

.notification.fade-out {
    animation: slideOutRight 0.3s ease-in;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.calendar-container {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow);
    overflow: hidden;
}

.calendar-header {
    padding: 20px;
    background: var(--light-green);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calendar-header h3 {
    margin: 0;
    color: var(--accent-green);
    font-weight: 600;
}

.calendar-grid {
    padding: 20px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--neutral-200);
    border-radius: 8px;
    overflow: hidden;
}

.calendar-day-header {
    background: var(--neutral-100);
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--neutral-600);
}

.calendar-date {
    background: var(--white);
    padding: 12px;
    text-align: center;
    cursor: pointer;
    position: relative;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.calendar-date:hover {
    background: var(--light-green);
}

.calendar-date.has-question {
    background: var(--light-green);
}

.calendar-date.has-question .date-number {
    font-weight: 600;
    color: var(--accent-green);
}

.question-indicator {
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    margin-top: 4px;
}

.trivia-calendar-view {
    display: none;
}

.trivia-calendar-view.active {
    display: block;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: between;
    margin-bottom: 32px;
    gap: 24px;
}

.page-header h2 {
    flex: 1;
    margin: 0;
    color: var(--neutral-800);
    font-size: 28px;
    font-weight: 600;
}

.page-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.livestream-container {
    max-width: 800px;
}

.current-stream-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px var(--shadow);
}

.stream-header {
    display: flex;
    align-items: center;
    justify-content: between;
    margin-bottom: 20px;
}

.stream-header h3 {
    margin: 0;
    color: var(--neutral-800);
    font-weight: 600;
}

.stream-details h4 {
    margin: 0 0 12px 0;
    color: var(--neutral-800);
    font-size: 20px;
    font-weight: 600;
}

.stream-details p {
    margin-bottom: 20px;
    color: var(--neutral-600);
    line-height: 1.6;
}

.stream-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--neutral-600);
}

.meta-item i {
    width: 16px;
    color: var(--accent-green);
}

.meta-item a {
    color: var(--accent-green);
    text-decoration: none;
}

.meta-item a:hover {
    text-decoration: underline;
}

.stream-actions {
    display: flex;
    gap: 12px;
}

.no-stream-card {
    background: var(--white);
    border-radius: 12px;
    padding: 48px 24px;
    box-shadow: 0 4px 6px var(--shadow);
    text-align: center;
}

.empty-state i {
    font-size: 48px;
    color: var(--neutral-400);
    margin-bottom: 16px;
}

.empty-state h3 {
    margin: 0 0 12px 0;
    color: var(--neutral-700);
    font-weight: 600;
}

.empty-state p {
    margin-bottom: 24px;
    color: var(--neutral-500);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.user-details {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.user-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    flex: 1;
}

.user-info h4 {
    margin: 0 0 8px 0;
    color: var(--neutral-800);
    font-size: 20px;
}

.user-info>p {
    margin-bottom: 20px;
    color: var(--neutral-600);
}

.user-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-stats .stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-stats .stat label {
    font-weight: 600;
    color: var(--neutral-700);
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions {
        justify-content: stretch;
    }

    .stream-meta {
        gap: 8px;
    }

    .meta-item {
        font-size: 14px;
    }

    .user-details {
        flex-direction: column;
        text-align: center;
    }

    .notification {
        left: 20px;
        right: 20px;
        min-width: auto;
    }

    .calendar-days {
        gap: 2px;
    }

    .calendar-date {
        padding: 8px;
        min-height: 50px;
    }
}

.pagination-wrapper {
    padding: 20px 24px;
}


/* Flex utilities */
.d-flex {
    display: flex;
}

.justify-content-end {
    justify-content: flex-end;
}

/* Margin utilities */
.mt-3 {
    margin-top: 1rem;
    /* same as Bootstrap's mt-3 */
}

/* ========== FLEXBOX & DISPLAY HELPERS ========== */
.d-flex {
    display: flex;
}

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

.flex-fill {
    flex: 1 1 auto;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-end {
    justify-content: flex-end;
}

.align-items-sm-center {
    align-items: center;
}

.w-100 {
    width: 100%;
}

/* ========== RESPONSIVE (MOBILE FIRST) ========== */
@media (min-width: 576px) {
    .d-sm-flex {
        display: flex !important;
    }

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

    .flex-sm-fill {
        flex: 1 1 auto !important;
    }

    .justify-content-sm-between {
        justify-content: space-between;
    }
}

/* ========== TYPOGRAPHY HELPERS ========== */
.small {
    font-size: 0.875rem;
}

.text-muted {
    color: #6c757d;
    /* Gray */
}

.fw-semibold {
    font-weight: 600;
}

/* ========== PAGINATION COMPONENT ========== */
.pagination {
    display: flex;
    list-style: none;
    padding-left: 0;
    border-radius: 0.375rem;
    gap: 4px;
}

.page-item {
    display: inline-block;
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: #198754;
    /* green (Bootstrap success-like) */
    border-color: #198754;
}

.page-link {
    position: relative;
    display: block;
    padding: 0.375rem 0.75rem;
    margin-left: -1px;
    line-height: 1.5;
    color: #198754;
    background-color: #fff;
    border: 1px solid #dee2e6;
    text-decoration: none;
    border-radius: 0.25rem;
    transition: all 0.2s ease-in-out;
}

.page-link:hover {
    z-index: 2;
    color: #145c32;
    background-color: #e9ecef;
    border-color: #dee2e6;
}