/* ReadPlayLearn Premium Admin Theme */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --sidebar-bg: rgba(30, 41, 59, 0.7);
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --sidebar-width: 260px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    overflow-x: hidden;
}

h1:not([class^="swal2-"]),
h2:not([class^="swal2-"]),
h3:not([class^="swal2-"]),
h4:not([class^="swal2-"]),
h5:not([class^="swal2-"]),
h6:not([class^="swal2-"]) {
    color: var(--text-main) !important;
    font-weight: 600;
}

.text-muted {
    color: #cbd5e1 !important;
    /* Brighter slate for better visibility */
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
    /* Slightly brighter for readability */
}

/* Form labels - ensure they're always visible */
.form-label {
    color: #cbd5e1 !important;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Glassmorphism Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 24px 16px;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 0 12px 32px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.sidebar-logo i {
    color: var(--primary-color);
    margin-right: 12px;
    font-size: 1.8rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 12px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link i {
    font-size: 1.25rem;
    margin-right: 12px;
    transition: var(--transition);
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.nav-link.active i {
    color: #ffffff;
}

/* Main Content Area */
main {
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent 400px),
        radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.05), transparent 400px);
}

/* Premium Dashboard Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.analytics-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    transition: var(--transition);
    height: 100%;
}

.analytics-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.smaller {
    font-size: 0.75rem;
    font-weight: 500;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.stat-label {
    color: #cbd5e1;
    /* Brighter for readability */
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Table Customization */
.table-container {
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    padding: 8px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
    color: var(--text-main);
}

.table th {
    background: transparent;
    color: #cbd5e1;
    /* Brighter slate for better contrast */
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    padding: 16px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.table td {
    padding: 16px 24px;
    vertical-align: middle;
    border-bottom: 1px solid var(--glass-border);
    background: transparent;
    color: #f1f5f9;
    /* Slate 100 for high visibility */
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Custom UI Components */
.btn {
    border-radius: 10px;
    font-weight: 500;
    padding: 8px 20px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    color: #ffffff !important;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-outline-secondary {
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-main) !important;
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff !important;
    transform: translateY(-2px);
}

.btn-icon-only {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    color: var(--text-muted) !important;
}

.btn-icon-only:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main) !important;
    border-color: var(--glass-border);
}

.btn-icon-only.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger) !important;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8125rem;
}

/* Redefine Primary to ensure it's not overridden by base .btn */
.btn-primary {
    background: var(--primary-color);
    border: none;
    color: white;
}

.badge {
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.bg-primary-subtle {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #a5b4fc !important;
}

.bg-success-subtle {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
}

.bg-secondary-subtle {
    background: rgba(148, 163, 184, 0.15) !important;
    color: #cbd5e1 !important;
}

.bg-danger-subtle {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
}

.bg-warning-subtle {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fcd34d !important;
}

.search-container {
    position: relative;
}

.search-container i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 16px 10px 44px;
    color: var(--text-main);
    width: 100%;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

/* Fix select dropdown options visibility */
select.search-input option {
    background: #ffffff;
    color: #1e293b;
    padding: 10px;
}

select.search-input option:hover,
select.search-input option:focus,
select.search-input option:checked {
    background: var(--primary-color);
    color: #ffffff;
}

/* Form select styling */
.form-select {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

.form-select option {
    background: #ffffff;
    color: #1e293b;
}

.form-select option:hover,
.form-select option:checked {
    background: var(--primary-color);
    color: #ffffff;
}

/* Charts */
.chart-container {
    height: 300px;
    margin-top: 16px;
}

/* Modal Fixes - Ensure text is visible on light backgrounds */
.modal-content {
    background: #ffffff;
    color: #1e293b;
    border-radius: 16px;
    border: none;
}

.modal-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 16px 16px 0 0;
    padding: 20px 24px;
}

.modal-title {
    color: #0f172a !important;
    font-weight: 600;
    font-size: 1.25rem;
}

.modal-body {
    padding: 24px;
    color: #1e293b;
}

.modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 16px 16px;
    padding: 16px 24px;
}

/* Form elements in modals */
.modal-body .form-label {
    color: #334155 !important;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.875rem;
}

.modal-body .form-control,
.modal-body .form-select {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 14px;
    color: #1e293b;
    transition: all 0.2s;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.modal-body .form-control::placeholder {
    color: #94a3b8;
}

.modal-body textarea.form-control {
    resize: vertical;
}

/* Close button in modal */
.btn-close {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.btn-close:hover {
    opacity: 1;
}

/* Tables inside modals */
.modal-body .table {
    color: #1e293b;
}

.modal-body .table thead th {
    color: #0f172a !important;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.modal-body .table tbody td {
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

/* Cards inside modals */
.modal-body .card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.modal-body .card-title {
    color: #0f172a !important;
}

.modal-body .card-body {
    color: #1e293b;
}

/* Paragraphs in modal */
.modal-body p {
    color: #475569;
}

.modal-body h6 {
    color: #0f172a !important;
    font-weight: 600;
    margin-bottom: 1rem;
}

.modal-body strong {
    color: #1e293b;
    font-weight: 600;
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    main {
        margin-left: 0;
        padding: 16px;
    }
}

/* SweetAlert Global Overrides */
.swal2-popup {
    font-family: 'Outfit', sans-serif !important;
    border-radius: 20px !important;
}

.swal2-title {
    color: #0f172a !important;
    font-weight: 700 !important;
}

.swal2-html-container {
    color: #334155 !important;
}

.swal2-popup .form-label {
    color: #334155 !important;
    font-weight: 600 !important;
}

.swal2-popup .text-muted {
    color: #64748b !important;
}

.swal2-popup .form-control,
.swal2-popup .form-select {
    color: #1e293b !important;
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
}

.swal2-popup .form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

.swal2-popup .form-control::placeholder {
    color: #94a3b8 !important;
}

.swal2-popup strong {
    color: #0f172a !important;
    font-weight: 700 !important;
}

.swal2-popup p {
    color: #334155 !important;
}