/* =============================================================================
   Online Examination Portal - Main Stylesheet
   ============================================================================= */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #7c3aed;
    --success: #16a34a;
    --danger:  #dc2626;
    --warning: #f59e0b;
    --info:    #0ea5e9;
    --bg:      #f3f4f6;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: #1f2937; }

[data-bs-theme="dark"] body { background: #0f172a; color: #e2e8f0; }

/* ----------------- Navbar ----------------- */
.app-navbar, .student-navbar {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-bottom: 1px solid #e5e7eb;
}
.navbar-brand { font-size: 1.25rem; }

/* ----------------- Hero ----------------- */
.hero-section {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    padding: 60px 0;
    color: #fff;
}
.cta-section {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    padding: 60px 0;
}
.feature-icon {
    width: 64px; height: 64px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; margin: 0 auto 12px;
}
.feature-card { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 10px 25px rgba(0,0,0,0.08) !important; }
.exam-card { transition: transform 0.25s ease; }
.exam-card:hover { transform: translateY(-3px); }

/* ----------------- Cards & Stats ----------------- */
.stat-card { transition: transform 0.2s ease; }
.stat-card:hover { transform: translateY(-2px); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }

.welcome-card { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); }

/* ----------------- Auth Pages ----------------- */
.auth-bg { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); min-height: 100vh; }

/* ----------------- Dashboard Layouts ----------------- */
.student-bg { background: #f3f4f6; min-height: 100vh; }
.admin-bg { background: #f3f4f6; min-height: 100vh; }

.user-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
}

/* ----------------- Result Page ----------------- */
.result-circle {
    width: 180px; height: 180px;
    border-radius: 50%;
    margin: 0 auto;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: bold;
}
.result-circle.pass { background: linear-gradient(135deg, #16a34a, #22c55e); }
.result-circle.fail { background: linear-gradient(135deg, #dc2626, #ef4444); }

/* ----------------- Instructions Page ----------------- */
.info-tile { background: #f9fafb; transition: all 0.2s; }
.info-tile:hover { background: #f3f4f6; transform: scale(1.03); }
.instruction-list { line-height: 1.9; }
.instruction-list li { margin-bottom: 8px; }

/* ----------------- Admin Sidebar ----------------- */
.admin-sidebar {
    width: 240px;
    min-height: 100vh;
    background: #1f2937;
    color: #d1d5db;
    position: fixed;
    top: 0; left: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s;
}
.admin-content { margin-left: 240px; }
.admin-sidebar .nav-link {
    color: #d1d5db;
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 2px;
    font-size: 14px;
    transition: background 0.2s;
}
.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active {
    background: #374151;
    color: #fff;
}
.admin-sidebar .nav-link i { margin-right: 8px; }
@media (max-width: 767.98px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-content { margin-left: 0; }
}

/* ----------------- Theme Toggle ----------------- */
.theme-toggle { padding: 0.4rem 0.7rem; }

/* ----------------- Buttons ----------------- */
.btn { border-radius: 8px; font-weight: 500; }

/* ----------------- Tables ----------------- */
.table > :not(caption) > * > * { padding: 0.75rem 0.75rem; }

/* ----------------- Print ----------------- */
@media print {
    .no-print, .app-navbar, .student-navbar, .admin-sidebar, footer { display: none !important; }
    .admin-content { margin: 0 !important; }
}

/* ----------------- Animations ----------------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.card, .alert { animation: fadeIn 0.3s ease; }
