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

:root {
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.98);
    --border-color: rgba(99, 102, 241, 0.12);
    --border-color-active: rgba(99, 102, 241, 0.35);
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --accent-glow: 0 10px 30px rgba(99, 102, 241, 0.08);
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    letter-spacing: -0.01em;
}

/* Glassmorphism card utility */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(148, 163, 184, 0.12);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: var(--border-color-active);
    box-shadow: var(--accent-glow);
}

/* Sidebar Styling */
.sidebar {
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    z-index: 1000;
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-brand-logo {
    height: 38px;
    width: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 0 0.75rem;
    margin: 0;
    flex-grow: 1;
}

.menu-item {
    margin-bottom: 0.25rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.925rem;
    transition: var(--transition-smooth);
}

.menu-link:hover, .menu-link.active {
    color: #4f46e5;
    background: rgba(99, 102, 241, 0.08);
}

.menu-link.active {
    border-left: 3px solid #6366f1;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
}

/* Layout Main Content */
.main-wrapper {
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

/* Stats dashboard cards styling */
.stat-card-val {
    font-size: 2.25rem;
    font-weight: 700;
    background: linear-gradient(to right, #0f172a, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-icon {
    font-size: 1.75rem;
    padding: 0.5rem;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;
}

/* Tables styling */
.custom-table {
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    width: 100%;
}

.custom-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border: none !important;
}

.custom-table tbody tr {
    background: rgba(255, 255, 255, 0.55);
    transition: var(--transition-smooth);
}

.custom-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.98);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.08);
}

.custom-table td {
    padding: 1rem;
    vertical-align: middle;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.custom-table td:first-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.custom-table td:last-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Form inputs */
.form-control, .form-select {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: var(--transition-smooth);
}

.form-control:focus, .form-select:focus {
    background-color: #ffffff;
    border-color: #6366f1;
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.15);
    color: var(--text-primary);
}

.form-label {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a52ff 0%, #8b4eff 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-muted);
    border-radius: 8px;
}

.btn-outline-secondary:hover {
    background-color: #f1f5f9;
    color: var(--text-primary);
    border-color: var(--border-color-active);
}

/* Login page layout */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.06) 0%, rgba(255, 255, 255, 0) 60%), var(--bg-main);
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
}

.login-brand-logo {
    height: 48px;
    width: auto;
}

/* Code Editor Textarea */
.json-textarea {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid var(--border-color) !important;
}

/* Custom Badges */
.badge-learning-path {
    background-color: rgba(124, 58, 237, 0.08);
    color: #6d28d9;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.badge-assessment {
    background-color: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-quiz {
    background-color: rgba(16, 185, 129, 0.08);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-published {
    background-color: rgba(16, 185, 129, 0.1);
    color: #047857;
}

.badge-pending {
    background-color: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

.badge-unpublished {
    background-color: rgba(107, 114, 128, 0.1);
    color: #4b5563;
}

.badge-removed {
    background-color: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

/* Toast styling */
.toast-container {
    z-index: 1060;
}
.custom-toast {
    background-color: #ffffff !important;
    border: 1px solid var(--border-color-active) !important;
    color: var(--text-primary) !important;
}

/* Drag handles for curation */
.drag-row {
    cursor: move;
}

/* --- Bootstrap Compatibility Overrides for Light Mode --- */

.bg-dark {
    background-color: #ffffff !important;
}

.border-secondary {
    border-color: var(--border-color) !important;
}

/* Neutralise dark-mode text classes used in templates */
.text-white {
    color: var(--text-primary) !important;
}

.text-light {
    color: var(--text-muted) !important;
}

/* Keep badge/button text untouched */
.badge.text-white,
.btn.text-white,
.bg-primary .text-white,
.bg-success .text-white,
.bg-danger .text-white {
    color: #fff !important;
}

.btn-close-white {
    filter: none !important;
}

.progress.bg-dark {
    background-color: #e2e8f0 !important;
}

/* Modal overrides — force light background */
.modal-content.bg-dark,
.modal-content {
    background-color: #ffffff !important;
    color: var(--text-primary) !important;
}

.modal-header.border-secondary,
.modal-footer.border-secondary {
    border-color: var(--border-color) !important;
}

/* Pagination light mode */
.page-link.bg-dark {
    background-color: #ffffff !important;
    color: var(--text-primary) !important;
}

.page-link.bg-dark.text-white {
    color: var(--text-primary) !important;
}

.page-link.text-muted {
    color: var(--text-muted) !important;
}

/* Input group addons */
.input-group-text.bg-transparent {
    background-color: transparent !important;
    border-color: var(--border-color) !important;
    color: var(--text-muted) !important;
}
