/* Online Examination Portal Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+Tamil:wght@400;500;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #475569;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --dark: #0f172a;
    --light: #f8fafc;
    --border-color: #e2e8f0;
    --sidebar-width: 260px;
    --font-base: 'Inter', sans-serif;
    --font-tamil: 'Noto Sans Tamil', 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-base);
    background-color: #f1f5f9;
    color: #334155;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Tamil font class */
.font-tamil, .tamil-text {
    font-family: var(--font-tamil) !important;
    line-height: 1.6;
}

/* Question & Option styling */
.question-content {
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.7;
    color: #1e293b;
}

.option-box {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: #ffffff;
    display: flex;
    align-items: center;
}

.option-box:hover {
    border-color: #93c5fd;
    background-color: #f8fafc;
}

.option-box.selected {
    border-color: var(--primary);
    background-color: var(--primary-light);
    box-shadow: 0 0 0 1px var(--primary);
}

.option-badge {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.option-box.selected .option-badge {
    background-color: var(--primary);
    color: #ffffff;
}

/* Question Palette for CBT */
.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    gap: 6px;
    padding: 2px;
}

.palette-btn {
    width: 34px;
    height: 34px;
    margin: 0 auto;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.8rem;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.palette-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.palette-btn.active {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.palette-btn.status-answered {
    background-color: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

.palette-btn.status-unanswered {
    background-color: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.palette-btn.status-review {
    background-color: #8b5cf6;
    color: #ffffff;
    border-color: #8b5cf6;
}

.palette-btn.status-review-answered {
    background-color: #6366f1;
    color: #ffffff;
    border-color: #6366f1;
    position: relative;
}

.palette-btn.status-review-answered::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 5px;
    height: 5px;
    background-color: #10b981;
    border-radius: 50%;
}

.palette-btn.status-not-visited {
    background-color: #e2e8f0;
    color: #64748b;
}

/* Timer Display */
.exam-timer {
    font-family: monospace;
    font-size: 1.4rem;
    font-weight: 700;
    padding: 6px 16px;
    background: #0f172a;
    color: #38bdf8;
    border-radius: 8px;
    letter-spacing: 1px;
}

.exam-timer.warning {
    color: #f87171;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Custom Cards & Shadows */
.card {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.card-dashboard {
    border: none;
    border-radius: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-dashboard:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* Admin Sidebar Layout */
.admin-wrapper {
    display: flex;
    width: 100%;
    min-height: calc(100vh - 65px);
}

.admin-sidebar {
    width: var(--sidebar-width);
    background-color: #0f172a;
    color: #94a3b8;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link {
    color: #94a3b8;
    padding: 12px 20px;
    font-weight: 500;
    border-radius: 8px;
    margin: 4px 12px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.admin-sidebar .nav-link i {
    width: 24px;
    margin-right: 10px;
    font-size: 1.1rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.admin-sidebar .nav-link.active {
    background-color: var(--primary);
    color: #ffffff;
}

.admin-content {
    flex-grow: 1;
    background-color: #f8fafc;
    padding: 2rem;
    overflow-y: auto;
}

/* Navbar */
.navbar-custom {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand-logo {
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

/* Tables */
.table-custom {
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom thead th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
}

.table-custom tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

/* Badges */
.badge-soft-primary { background-color: #dbeafe; color: #1e40af; }
.badge-soft-success { background-color: #dcfce7; color: #166534; }
.badge-soft-warning { background-color: #fef3c7; color: #92400e; }
.badge-soft-danger { background-color: #fee2e2; color: #991b1b; }
.badge-soft-info { background-color: #cffafe; color: #155e75; }

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: #ffffff;
        padding: 1rem;
        border-radius: 12px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.08);
        margin-top: 0.5rem;
        border: 1px solid #e2e8f0;
    }
    .navbar-nav .nav-link {
        padding: 0.6rem 0.8rem;
        border-radius: 8px;
    }
    .navbar-nav .nav-link:hover {
        background-color: #f1f5f9;
    }
    .admin-wrapper {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
    }
    .admin-content {
        padding: 1rem;
    }
}

/* Mobile CBT Exam Screen Optimization */
@media (max-width: 767.98px) {
    .exam-timer {
        font-size: 1.1rem;
        padding: 4px 10px;
    }
    .question-content {
        font-size: 1.05rem;
        line-height: 1.6;
    }
    .option-box {
        padding: 12px 14px;
        border-radius: 10px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    .option-badge {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
        margin-right: 10px;
        border-radius: 6px;
    }
    .palette-btn {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
        touch-action: manipulation;
    }
    .exam-nav-btn-group {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .exam-nav-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }
    .exam-nav-row .btn {
        width: 100%;
        padding: 8px 10px;
        font-size: 0.85rem;
    }
}
