/* ==========================================================================
   EduSmart Premium Design System & Stylesheet
   ========================================================================== */

:root {
    --primary-color: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;
    --secondary-color: #8b5cf6; /* Violet */
    --secondary-hover: #7c3aed;
    --success-color: #10b981; /* Emerald */
    --success-hover: #059669;
    --success-light: #d1fae5;
    --warning-color: #f59e0b; /* Amber */
    --danger-color: #ef4444; /* Rose */
    --danger-hover: #dc2626;
    --danger-light: #fee2e2;
    
    /* Light Theme (SaaS Premium Dashboard) */
    --bg-main: #f8fafc; /* Slate 50 */
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a; /* Slate 900 (Dark Sidebar for contrast) */
    --sidebar-text: #94a3b8; /* Slate 400 */
    --sidebar-active: #ffffff;
    --border-color: #e2e8f0; /* Slate 200 */
    --text-main: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */
    --text-white: #ffffff;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-indigo: 0 4px 14px 0 rgba(99, 102, 241, 0.3);
    
    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;
    --radius-full: 9999px;
    
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ==========================================================================
   Base & Resets
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulseBorder {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.animate-slide-in {
    animation: slideInRight 0.3s ease-out forwards;
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* ==========================================================================
   Landing Page (Role Selection)
   ========================================================================== */
.landing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgb(240, 243, 255) 0%, rgb(255, 255, 255) 90%);
    padding: 2rem;
}

.landing-header {
    text-align: center;
    margin-bottom: 3.5rem;
    max-width: 600px;
    animation: fadeIn 0.6s ease-out;
}

.logo-brand {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.logo-brand i {
    margin-right: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 500;
}

.role-cards {
    display: flex;
    gap: 2rem;
    max-width: 900px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.role-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    width: 320px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.role-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg), var(--shadow-indigo);
    border-color: var(--primary-color);
}

.role-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    background-color: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    transition: var(--transition-base);
}

.role-card:hover .role-icon {
    background-color: var(--primary-color);
    color: var(--text-white);
    transform: scale(1.1);
}

.role-card.admin-role:hover .role-icon {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #a78bfa 100%);
    color: var(--text-white);
}

.role-card.admin-role .role-icon {
    background-color: #f5f3ff;
    color: var(--secondary-color);
}

.role-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.role-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ==========================================================================
   Login / Register Pages
   ========================================================================== */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgb(243, 244, 246) 0%, rgb(255, 255, 255) 90%);
    padding: 2rem;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    padding: 3rem 2.5rem;
    animation: fadeIn 0.4s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    transition: var(--transition-base);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-main);
    transition: var(--transition-base);
    font-weight: 500;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-color);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-input:focus + i {
    color: var(--primary-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
    outline: none;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-white);
    box-shadow: var(--shadow-indigo);
}

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

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #cbd5e1;
}

.btn-success {
    background-color: var(--success-color);
    color: var(--text-white);
}

.btn-success:hover {
    background-color: var(--success-hover);
}

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

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

.btn-block {
    width: 100%;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 600;
    margin-left: 0.25rem;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.back-to-home {
    display: inline-flex;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-base);
}

.back-to-home:hover {
    color: var(--primary-color);
    transform: translateX(-3px);
}

.back-to-home i {
    margin-right: 0.5rem;
}

/* ==========================================================================
   Dashboard Layout Structure
   ========================================================================== */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    transition: var(--transition-base);
    z-index: 100;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-brand i {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-user {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-grow: 1;
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-base);
    cursor: pointer;
    gap: 0.75rem;
}

.menu-item a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.menu-item:hover a, 
.menu-item.active a {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--sidebar-active);
}

.menu-item.active a {
    border-left: 3px solid var(--primary-color);
    background-color: rgba(99, 102, 241, 0.15);
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.logout-btn {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    color: #f87171 !important; /* light red */
    cursor: pointer;
    transition: var(--transition-base);
    gap: 0.75rem;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
}

.logout-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents flex children from stretching */
    background-color: var(--bg-main);
}

.top-navbar {
    height: 70px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.navbar-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-notification {
    position: relative;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: var(--transition-base);
}

.nav-notification:hover {
    color: var(--primary-color);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: var(--text-white);
    font-size: 0.65rem;
    width: 15px;
    height: 15px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.content-body {
    padding: 2rem;
    flex-grow: 1;
    overflow-y: auto;
}

/* ==========================================================================
   Dashboard Page Components
   ========================================================================== */

/* Stat Cards Widget */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-base);
}

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

.stat-details h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-details p {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary { background-color: var(--primary-light); color: var(--primary-color); }
.stat-icon.secondary { background-color: #f5f3ff; color: var(--secondary-color); }
.stat-icon.success { background-color: var(--success-light); color: var(--success-color); }
.stat-icon.warning { background-color: #fffbeb; color: var(--warning-color); }

/* Dashboard Columns Layout */
.dashboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

.content-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.card-header-flex h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

/* ==========================================================================
   Table & Lists Styling
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.925rem;
}

.custom-table th {
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--bg-main);
}

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

.custom-table tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-success { background-color: var(--success-light); color: var(--success-color); }
.badge-danger { background-color: var(--danger-light); color: var(--danger-color); }
.badge-warning { background-color: #fffbeb; color: var(--warning-color); }
.badge-primary { background-color: var(--primary-light); color: var(--primary-color); }

/* List items styling */
.custom-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-base);
}

.list-item:hover {
    border-color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.01);
}

.list-item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.list-item-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background-color: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.list-item-text h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.list-item-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   E-learning Specific Components (Materi, Latihan, Kuis)
   ========================================================================== */

/* Grid layout for learning items */
.learning-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.learning-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: var(--transition-base);
}

.learning-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), 0 4px 20px rgba(99, 102, 241, 0.05);
    border-color: var(--primary-color);
}

.card-banner {
    height: 120px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 1.25rem;
    display: flex;
    align-items: flex-end;
    color: var(--text-white);
    position: relative;
}

.card-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3z'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.card-banner-subject {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(5px);
}

.learning-card-body {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.learning-card-body h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    line-height: 1.4;
}

.learning-card-body p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.5;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.learning-card-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.read-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--success-color);
    font-weight: 600;
}

/* Material Detail View */
.material-detail {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    max-width: 800px;
    margin: 0 auto;
}

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

.material-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

.material-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-main);
    margin-bottom: 2.5rem;
}

.material-body p {
    margin-bottom: 1.25rem;
}

.material-body h3 {
    margin: 1.5rem 0 0.75rem 0;
    font-size: 1.3rem;
}

.material-body ul, .material-body ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.material-body li {
    margin-bottom: 0.5rem;
}

.material-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

/* ==========================================================================
   Practice & Quiz Interface
   ========================================================================== */
.exam-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .exam-layout {
        grid-template-columns: 1fr;
    }
}

.question-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.question-number {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.exam-timer {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--danger-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--danger-light);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-md);
}

.question-text {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.option-item {
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.option-item:hover {
    border-color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.02);
}

.option-prefix {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    transition: var(--transition-base);
    background-color: var(--bg-main);
}

.option-item.selected {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.option-item.selected .option-prefix {
    background-color: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

/* Practice immediate feedback classes */
.option-item.correct {
    border-color: var(--success-color);
    background-color: var(--success-light);
}
.option-item.correct .option-prefix {
    background-color: var(--success-color);
    color: var(--text-white);
    border-color: var(--success-color);
}

.option-item.wrong {
    border-color: var(--danger-color);
    background-color: var(--danger-light);
}
.option-item.wrong .option-prefix {
    background-color: var(--danger-color);
    color: var(--text-white);
    border-color: var(--danger-color);
}

.practice-explanation {
    background-color: #f0fdf4; /* ultra light emerald */
    border-left: 4px solid var(--success-color);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.practice-explanation strong {
    color: var(--success-hover);
    display: block;
    margin-bottom: 0.25rem;
}

/* Navigasi Soal / Grid Panel (Right Sidebar) */
.nav-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: fit-content;
}

.nav-panel h4 {
    font-size: 0.95rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.q-grid-btn {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-base);
}

.q-grid-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.q-grid-btn.active {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: var(--text-white);
}

.q-grid-btn.answered {
    background-color: #e0f2fe; /* Light sky blue */
    border-color: #bae6fd;
    color: #0369a1;
}

.q-grid-btn.correct {
    background-color: var(--success-light);
    border-color: #a7f3d0;
    color: var(--success-hover);
}

.q-grid-btn.wrong {
    background-color: var(--danger-light);
    border-color: #fecaca;
    color: var(--danger-hover);
}

/* Quiz Finished Scoreboard */
.results-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    max-width: 600px;
    margin: 0 auto;
    padding: 3rem 2rem;
    text-align: center;
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: var(--radius-full);
    border: 8px solid var(--primary-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem auto;
}

.score-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1.1;
}

.score-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.results-card h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.results-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    background-color: var(--bg-main);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

.result-stat-item h6 {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.result-stat-item p {
    font-size: 1.1rem;
    font-weight: 700;
}

/* ==========================================================================
   AI Review Styling
   ========================================================================== */
.ai-review-section {
    margin-top: 2rem;
    text-align: left;
    border-top: 1px dashed var(--border-color);
    padding-top: 2rem;
}

.ai-review-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.ai-badge {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-white);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.ai-review-card {
    background: linear-gradient(to right bottom, #faf5ff, #f5f3ff); /* Gradient violet ultra-light */
    border: 1px solid #ddd6fe;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.ai-review-card::before {
    content: '\f54e'; /* robot icon code in fontawesome */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: -10px;
    bottom: -15px;
    font-size: 6rem;
    color: rgba(139, 92, 246, 0.05);
    transform: rotate(-15deg);
    pointer-events: none;
}

.ai-typing-effect {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #4c1d95; /* Deep purple text */
}

/* AI review details styling (markdown-like parsed output) */
.ai-review-content h4 {
    color: #6d28d9;
    font-size: 1.05rem;
    margin: 1.25rem 0 0.5rem 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-review-content h4:first-child {
    margin-top: 0;
}

.ai-review-content p {
    margin-bottom: 0.75rem;
}

.ai-review-content ul {
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
}

.ai-review-content li {
    margin-bottom: 0.35rem;
}

/* Loading Dots */
.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.5rem 1rem;
    background-color: rgba(99, 102, 241, 0.08);
    border-radius: var(--radius-full);
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    border-radius: var(--radius-full);
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ==========================================================================
   Modals & Forms Styling
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.modal-overlay.open .modal-card {
    transform: translateY(0);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: var(--transition-base);
}

.modal-close-btn:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Custom Select Style */
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-main);
    font-weight: 500;
    outline: none;
    transition: var(--transition-base);
}

.form-select:focus {
    border-color: var(--primary-color);
    background-color: var(--bg-card);
}

.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-main);
    font-weight: 500;
    outline: none;
    min-height: 120px;
    resize: vertical;
    transition: var(--transition-base);
}

.form-textarea:focus {
    border-color: var(--primary-color);
    background-color: var(--bg-card);
}

/* Dynamic Add Question Section in Quiz Creator */
.questions-creator-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.question-creator-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    background-color: var(--bg-main);
    position: relative;
}

.remove-question-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--danger-color);
    cursor: pointer;
}

/* ==========================================================================
   Toast Notifications Styling
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 999;
}

.toast {
    background-color: var(--bg-sidebar);
    color: var(--text-white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 250px;
    animation: slideInRight 0.3s ease-out;
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast-info {
    border-left: 4px solid var(--primary-color);
}

/* ==========================================================================
   Responsive Sidebar / Mobile Navigation
   ========================================================================== */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .sidebar-menu {
        flex-direction: row;
        padding: 0.75rem;
        overflow-x: auto;
        gap: 0.5rem;
    }
    
    .sidebar-user {
        display: none;
    }
    
    .menu-item a {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .content-body {
        padding: 1rem;
    }
}

/* ==========================================================================
   Multimedia & Jumper Game Styles
   ========================================================================== */
.media-container {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.media-container svg,
.media-container video {
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.media-container svg:hover,
.media-container video:hover {
    box-shadow: var(--shadow-md);
}

.game-canvas-wrapper {
    position: relative;
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--border-color);
}

.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    color: #ffffff;
    padding: 1rem;
    z-index: 10;
    transition: var(--transition-base);
}

.game-overlay-content h4 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.game-overlay-content p {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

#game-canvas {
    background-color: #e0f2fe;
    image-rendering: auto;
    transition: var(--transition-base);
}

.game-dashboard {
    width: 100%;
}

