/* MCQ Learning Management System - E-learning Theme */
/* Bootstrap 5 Custom Theme with Dark Mode Support */

:root {
    /* Light Mode Colors */
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary-color: #06b6d4;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    
    --navbar-height: 70px;
    --sidebar-width: 280px;
    --transition-speed: 0.3s;
}

[data-theme="dark"] {
    /* Dark Mode Colors */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --secondary-color: #22d3ee;
    --success-color: #34d399;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
    --info-color: #60a5fa;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border-color: #475569;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.25);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    line-height: 1.6;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Navbar Styles */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
    height: var(--navbar-height);
    transition: all var(--transition-speed);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    font-size: 1.8rem;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin: 0 0.25rem;
    transition: all var(--transition-speed);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
}

/* Sidebar Styles */
.sidebar {
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    min-height: calc(100vh - var(--navbar-height));
    padding: 1.5rem 0;
    position: sticky;
    top: var(--navbar-height);
    transition: all var(--transition-speed);
}

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

.sidebar-header h5 {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-speed);
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--bg-secondary);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-menu i {
    width: 20px;
    margin-right: 0.75rem;
}

/* Class Level Pills */
.class-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1.5rem;
    margin-bottom: 1rem;
}

.class-level-pill {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-speed);
}

.class-level-pill:hover,
.class-level-pill.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Main Content Area */
.main-content {
    padding: 2rem;
    min-height: calc(100vh - var(--navbar-height));
}

/* Card Styles */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed);
    margin-bottom: 1.5rem;
}

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

.card-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

/* MCQ Question Styles */
.question-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all var(--transition-speed);
}

.question-card:hover {
    box-shadow: var(--shadow-md);
}

.question-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.options-grid {
    display: grid;
    gap: 1rem;
}

.option-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.option-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

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

.option-item.correct {
    background: var(--success-color);
    color: white;
    border-color: #059669;
}

.option-item.wrong {
    background: var(--danger-color);
    color: white;
    border-color: #dc2626;
}

.option-label {
    font-weight: 600;
    font-size: 1.1rem;
    min-width: 30px;
}

.option-text {
    flex: 1;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

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

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

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

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

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

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* Mode Toggle Buttons */
.mode-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.mode-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.mode-btn:hover {
    background: var(--bg-secondary);
}

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

/* Timer Styles */
.timer-display {
    background: var(--bg-tertiary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    border: 2px solid var(--border-color);
    margin-bottom: 1rem;
}

.timer-display.warning {
    background: var(--warning-color);
    color: white;
    border-color: #d97706;
    animation: pulse 1s infinite;
}

.timer-display.danger {
    background: var(--danger-color);
    color: white;
    border-color: #dc2626;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Progress Bar Styles */
.progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    height: 100%;
    transition: width 0.5s ease;
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-speed);
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stats-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Badge Styles */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.badge-warning {
    background: var(--warning-color);
    color: white;
}

.badge-info {
    background: var(--info-color);
    color: white;
}

/* Dark Mode Toggle */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-speed);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

/* Calculator Styles */
.calculator {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-md);
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    z-index: 999;
    transition: all var(--transition-speed);
}

.calculator.hidden {
    transform: translateX(400px);
}

.calc-display {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-size: 1.25rem;
    text-align: right;
    margin-bottom: 0.5rem;
    min-height: 50px;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.calc-btn {
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.calc-btn:hover {
    background: var(--primary-color);
    color: white;
}

.calc-btn.equals {
    grid-column: span 2;
    background: var(--success-color);
    color: white;
}

/* Alert Styles */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--success-color);
    color: var(--success-color);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--danger-color);
    color: var(--danger-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: var(--warning-color);
    color: var(--warning-color);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--info-color);
    color: var(--info-color);
}

/* Modal Styles */
.modal {
    background: rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: var(--navbar-height);
        width: var(--sidebar-width);
        height: calc(100vh - var(--navbar-height));
        z-index: 1040;
        transition: left var(--transition-speed);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .calculator {
        right: 1rem;
        bottom: 5rem;
    }
    
    .theme-toggle {
        right: 1rem;
        bottom: 1rem;
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 576px) {
    .question-text {
        font-size: 1rem;
    }
    
    .option-item {
        padding: 0.75rem 1rem;
    }
    
    .mode-selector {
        flex-direction: column;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .sidebar,
    .theme-toggle,
    .calculator,
    .btn,
    .mode-selector {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
    }
    
    .question-card {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles */
.btn:focus,
.option-item:focus,
.mode-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

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

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

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Custom Scrollbar for Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-tertiary);
}
