@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: #eef2ff;
    --secondary: #0ea5e9;
    --success: #10b981;
    --success-soft: #d1fae5;
    --warning: #f59e0b;
    --warning-soft: #fef3c7;
    --danger: #ef4444;
    --danger-soft: #fee2e2;
    --dark: #0f172a;
    --slate: #475569;
    --border: #e2e8f0;
    --bg-body: #f8fafc;
    --surface: #ffffff;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--dark);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* Solid Non-Transparent Form Inputs */
.form-control, .form-select {
    background-color: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 10px !important;
    padding: 0.6rem 0.9rem !important;
    font-size: 0.9rem !important;
    color: var(--dark) !important;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.15) !important;
    outline: none;
}

.form-check-input {
    width: 1.15em;
    height: 1.15em;
    cursor: pointer;
    border: 1.5px solid #94a3b8;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Sidebar & Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 268px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    padding: 1.25rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.28);
}

.sidebar-menu {
    padding: 0.85rem 0.85rem;
    flex: 1;
    overflow-y: auto;
}

.menu-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    padding: 0.75rem 0.75rem 0.3rem;
}

.nav-item-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0.65rem 0.85rem;
    border-radius: 11px;
    color: var(--slate);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 3px;
    transition: all 0.18s ease;
}

.nav-item-link:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.nav-item-link.active {
    background: var(--primary-soft);
    color: var(--primary);
}

.main-content {
    flex: 1;
    margin-left: 268px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 68px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.content-body {
    padding: 1.65rem;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

/* Cards & Stats */
.modern-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.35rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Toolbar & Bulk Action Bar */
.toolbar-box {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.bulk-action-bar {
    background: #0f172a;
    color: #ffffff;
    border-radius: 12px;
    padding: 0.7rem 1.15rem;
    margin-bottom: 1rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    animation: slideDown 0.2s ease;
}

.bulk-action-bar.show {
    display: flex;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn-primary-modern {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.58rem 1.15rem;
    font-weight: 600;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary-modern:hover {
    background: var(--primary-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* Exam UI Specifics */
.exam-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1050;
}

.timer-badge {
    background: #0f172a;
    color: #38bdf8;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    font-size: 1.15rem;
    padding: 0.45rem 1rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.timer-badge.danger {
    background: #fee2e2;
    color: #dc2626;
    animation: pulse 1s infinite;
}

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

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 0.95rem 1.1rem;
    border: 2px solid var(--border);
    border-radius: 14px;
    margin-bottom: 0.8rem;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.15s ease;
}

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

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

.option-letter {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #f1f5f9;
    color: var(--dark);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.nav-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.num-box {
    aspect-ratio: 1;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.num-box.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2.5px rgba(79, 70, 229, 0.25);
}

.num-box.answered {
    background: var(--success);
    border-color: var(--success);
    color: #ffffff;
}

.num-box.doubt {
    background: var(--warning);
    border-color: var(--warning);
    color: #ffffff;
}

/* Badges */
.badge-soft-primary { background: var(--primary-soft); color: var(--primary); font-weight: 600; padding: 4px 10px; border-radius: 8px; font-size: 0.78rem; }
.badge-soft-success { background: var(--success-soft); color: #065f46; font-weight: 600; padding: 4px 10px; border-radius: 8px; font-size: 0.78rem; }
.badge-soft-warning { background: var(--warning-soft); color: #92400e; font-weight: 600; padding: 4px 10px; border-radius: 8px; font-size: 0.78rem; }
.badge-soft-danger  { background: var(--danger-soft);  color: #991b1b; font-weight: 600; padding: 4px 10px; border-radius: 8px; font-size: 0.78rem; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .content-body { padding: 1.15rem; }
}
