/* Custom Styles for QPR Online Exam */

body {
    background-color: #f4f6fb;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

:root {
    --ink: #0f172a;
    --muted: #6b7280;
    --card: #ffffff;
    --soft: #f8fafc;
    --primary: #2563eb;
    --accent: #22d3ee;
}

/* Dashboard shell */
.content-wrapper.dashboard-modern {
    background: linear-gradient(180deg, #0b1224 0%, #0f172a 28%, #f4f6fb 28%);
    color: var(--ink);
}
.dashboard-modern .content {
    position: relative;
    z-index: 1;
}

/* Hero */
.page-hero.gradient-card {
    background: radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.25), transparent 30%),
                radial-gradient(circle at 80% 0%, rgba(37, 99, 235, 0.35), transparent 35%),
                linear-gradient(135deg, #111827 0%, #0b1224 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.75rem;
    color: #e5e7eb;
}
.hero-title {
    font-weight: 700;
    color: #fff;
}
.hero-subtitle {
    color: #cbd5e1;
    max-width: 560px;
}
.glass-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 1.25rem;
    color: #e5e7eb;
    min-width: 280px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.next-exam-card h4 {
    color: #fff;
}
.next-exam-card .btn-primary {
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.45);
}

/* Pills & chips */
.pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: .75rem;
    letter-spacing: .01em;
    border: 1px solid transparent;
}
.pill-light {
    background: rgba(255, 255, 255, 0.15);
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.25);
}
.pill-soft {
    background: #eef2ff;
    color: #4338ca;
    border-color: #e0e7ff;
}
.pill-glow {
    background: rgba(37, 99, 235, 0.14);
    color: #bfdbfe;
    border-color: rgba(191, 219, 254, 0.4);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

/* Stats row */
.stat-card {
    background: var(--card);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}
.bg-primary-soft { background: rgba(37, 99, 235, 0.12); }
.bg-info-soft { background: rgba(34, 211, 238, 0.14); }
.bg-success-soft { background: rgba(34, 197, 94, 0.16); }
.bg-warning-soft { background: rgba(234, 179, 8, 0.15); }

/* Panels */
.panel-card {
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #fff;
}
.panel-card .pill-soft {
    color: #4338ca;
}

/* Exam cards */
.exam-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.25rem;
    transition: transform .2s ease, box-shadow .2s ease;
}
.exam-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}
.icon-pill {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #eef2ff;
    display: grid;
    place-items: center;
}

/* Status chips */
.status-chip {
    display: inline-flex;
    align-items: center;
    padding: .35rem .65rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .78rem;
    border: 1px solid transparent;
}
.status-success {
    background: #e1f3e8;
    color: #137333;
    border-color: #c7e8d5;
}
.status-warning {
    background: #fff3d6;
    color: #b7791f;
    border-color: #ffe8b5;
}
.status-info {
    background: #e4f1ff;
    color: #1d4ed8;
    border-color: #c7ddff;
}
.status-muted {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

/* Table styling */
.table-modern thead th {
    background: #f8fafc;
    border-bottom: none;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: .78rem;
}
.table-modern tbody tr {
    border-bottom: 1px solid #e5e7eb;
}
.table-modern tbody tr:last-child {
    border-bottom: none;
}
.table-modern td, .table-modern th {
    vertical-align: middle;
}

.empty-state {
    background: #f8fafc;
    border: 1px dashed #d1d5db;
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
}

/* Exam question styling */
.question-card {
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}
.question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}
.badge-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: #eef2ff;
    color: #4338ca;
    border-radius: 999px;
    padding: .35rem .65rem;
    font-weight: 600;
    font-size: .85rem;
}
.question-progress {
    height: 8px;
    border-radius: 999px;
    background: #eef2ff;
}
.question-progress .progress-bar {
    background: linear-gradient(90deg, #2563eb, #22d3ee);
}
.palette-legend small {
    color: #6b7280;
}
.palette-legend {
    font-size: 0.85rem;
    color: #6b7280;
}
.q-palette-card {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}
.q-status-box {
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}
.q-status-box:hover {
    transform: translateY(-2px) scale(1.02);
}
.q-status-box.q-current {
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
}
.question-footer {
    border-top: 1px solid #edf2f7;
    padding-top: 1rem;
}
.option-label {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .6rem;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.option-label:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}
.option-label input[type="radio"] {
    display: none;
}
.option-label .option-letter {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 700;
    border: 1px solid #e0e7ff;
}
.option-label.selected {
    background: linear-gradient(120deg, #2563eb, #22d3ee);
    border-color: #1d4ed8;
    color: white;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}
.option-label.selected .option-letter {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
}

/* Result page */
.result-hero {
    background: linear-gradient(135deg, #0b1224 0%, #111827 100%);
    border-radius: 16px;
    padding: 1.75rem;
    color: #e5e7eb;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 12px 40px rgba(0,0,0,0.22);
}
.result-hero .status-icon {
    width: 74px;
    height: 74px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 1.9rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
}
.result-metric {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 1rem 1.25rem;
    box-shadow: 0 8px 20px rgba(15,23,42,0.06);
}
.result-metric .label {
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .02em;
    font-weight: 700;
    font-size: .8rem;
}
.result-metric .value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

@media (max-width: 767.98px) {
    .page-hero.gradient-card {
        padding: 1.25rem;
    }
    .glass-card {
        width: 100%;
        margin-top: 1rem;
    }
}

/* Card-based layout from memory */
.qpr-card {
    background: #ffffff;
    border: none; /* Remove default border */
    border-radius: .5rem; /* Softer corners */
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075) !important;
    border: 1px solid #dee2e6;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    height: 100%; /* Make cards in a row the same height */
}

/* Typography from memory */
.qpr-card .card-title, .qpr-card h1, .qpr-card h2, .qpr-card h3, .qpr-card h4, .qpr-card h5 {
    font-weight: 600;
    color: #343a40;
}
.text-muted {
    color: #6c757d !important;
}

/* Accent colors from memory */
.btn-primary, .btn-primary:hover {
    color: #fff !important; /* Ensure text on primary buttons is always white */
    background-color: #0d6efd;
    border-color: #0d6efd;
}
.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}
/* This is the new, more specific rule that will override the one below */
.content-wrapper a.btn.btn-primary {
    color: #fff !important;
}
.content-wrapper a, .text-primary {
    color: #0d6efd !important;
}
.content-wrapper a:hover {
    color: #0b5ed7 !important;
}

/* Flush tabs for a modern look */
.nav-tabs-flush .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    color: #6c757d;
    padding: 1rem;
}
.nav-tabs-flush .nav-link.active {
    border-bottom-color: #0d6efd;
    color: #0d6efd !important;
    font-weight: 600;
}

/* Custom modal styles */
.modal-content {
    border: none;
    border-radius: .5rem;
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important;
}

/* PDF Viewer Style from memory */
.pdf-viewer {
  border: 1px solid #dee2e6;
  border-radius: .25rem;
  min-height: 500px;
}

/* Styles for Exam Attempt page */
.timer-fixed {
    background-color: #fff;
    color: #343a40;
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky; /* Make it stick without covering content */
    top: 0;
    z-index: 1030;
    border-bottom: 1px solid #dee2e6;
}
.q-palette-card {
    position: sticky;
    top: 80px; /* Adjust based on timer bar height */
}

.q-status-box {
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 38px;
    cursor: pointer;
    border: 1px solid #dee2e6;
    margin: 4px;
    border-radius: 10px;
    font-weight: bold;
    background-color: #fff;
    transition: all 0.2s ease-in-out;
}
.q-answered {
    background-color: #eef5ff; /* Light blue from memory */
    border-color: #0d6efd;
    color: #0d6efd;
}
.q-current {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(13, 110, 253, 0.35);
}

/* Larger, more clickable radio buttons */
.option-label .badge {
    margin: 0;
}

/* Custom styles for dashboard card */
.card-bordered {
    border: 1px solid #dee2e6 !important;
    border-radius: .5rem !important;
    background-color: #fff !important;
}
.card-bordered .inner {
    color: #343a40 !important;
}
.card-bordered .small-box-footer {
    background-color: transparent !important;
    color: #0d6efd !important;
    font-weight: 600;
}
.card-bordered .small-box-footer:hover {
    background-color: rgba(13, 110, 253, 0.1) !important;
    color: #0b5ed7 !important;
}
