/* =====================================================
   SKY IELTS MOCK TEST PORTAL
   Professional Stylesheet
   ===================================================== */

:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #0f2744;
    --accent: #3182ce;
    --success: #38a169;
    --warning: #d69e2e;
    --danger: #e53e3e;
    --info: #3182ce;
    --bg: #f7fafc;
    --card-bg: #ffffff;
    --text: #1a202c;
    --text-muted: #718096;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --radius: 0.75rem;
    --sidebar-width: 260px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--primary-dark);
}

/* ---------- Auth Pages ---------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 50%, #3182ce 100%);
    padding: 1.5rem;
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    padding: 2.5rem;
}

.auth-card.register-card {
    max-width: 640px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-logo .logo-icon {
    width: 64px;
    height: 64px;
    background: var(--primary);
    color: #fff;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.auth-logo h1 {
    font-size: 1.35rem;
    margin: 0;
    letter-spacing: 0.5px;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.25rem 0 0;
}

/* ---------- Forms ---------- */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}

.form-control, .form-select {
    border-radius: 0.5rem;
    border-color: var(--border);
    padding: 0.6rem 0.9rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    border-radius: 0.5rem;
    padding: 0.65rem 1.5rem;
    font-weight: 500;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    border-radius: 0.5rem;
}

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

.btn-success {
    background-color: var(--success);
    border-color: var(--success);
    border-radius: 0.5rem;
}

.btn-danger {
    background-color: var(--danger);
    border-color: var(--danger);
    border-radius: 0.5rem;
}

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

.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-dark);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.sidebar-brand span {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-link {
    color: rgba(255,255,255,0.75);
    padding: 0.7rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.08);
    border-left-color: var(--accent);
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

.topbar .page-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    color: var(--primary-dark);
}

.content-area {
    padding: 1.5rem;
    flex: 1;
}

/* ---------- Cards ---------- */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border);
    height: 100%;
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
}

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

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* ---------- Welcome Banner ---------- */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
}

.welcome-banner h2 {
    color: #fff;
    margin-bottom: 0.5rem;
}

.welcome-banner .info-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.welcome-banner .badge-info {
    background: rgba(255,255,255,0.2);
    color: #fff;
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ---------- Instructions Card ---------- */
.instructions-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.instructions-card .card-body {
    padding: 1.75rem;
}

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

.instructions-list li {
    padding: 0.6rem 0;
    padding-left: 1.75rem;
    position: relative;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.instructions-list li:last-child {
    border-bottom: none;
}

.instructions-list li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--success);
}

/* ---------- Attempts Card ---------- */
.attempts-card {
    background: linear-gradient(135deg, #2c5282 0%, #3182ce 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.attempts-card .attempts-number {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.attempts-card .attempts-label {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* ---------- Exam Interface ---------- */
.exam-header {
    background: var(--primary-dark);
    color: #fff;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1050;
}

.exam-timer {
    background: rgba(255,255,255,0.15);
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

.exam-timer.warning {
    background: var(--warning);
    color: #1a202c;
}

.exam-timer.danger {
    background: var(--danger);
    animation: pulse 1s infinite;
}

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

.question-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 1rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.q-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.q-nav-btn:hover {
    border-color: var(--accent);
}

.q-nav-btn.answered {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.q-nav-btn.current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.question-panel {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1rem;
    box-shadow: var(--shadow);
}

.question-text {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.passage-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.7;
    font-size: 0.95rem;
}

.option-item {
    display: block;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
}

.option-item:hover {
    border-color: var(--accent);
    background: #ebf8ff;
}

.option-item input:checked + span,
.option-item.selected {
    border-color: var(--accent);
    background: #ebf8ff;
}

/* ---------- Tables ---------- */
.table {
    font-size: 0.9rem;
}

.table thead th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.badge-status {
    font-weight: 500;
    padding: 0.35em 0.7em;
    border-radius: 2rem;
}

/* ---------- Alerts / Toasts ---------- */
.alert {
    border-radius: 0.5rem;
    border: none;
}

/* ---------- Mobile ---------- */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--primary);
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1035;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

/* ---------- Footer ---------- */
.app-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}

/* ---------- Utility ---------- */
.text-primary-dark { color: var(--primary-dark) !important; }
.bg-primary-soft { background: rgba(26, 54, 93, 0.08); }
.bg-success-soft { background: rgba(56, 161, 105, 0.12); }
.bg-warning-soft { background: rgba(214, 158, 46, 0.12); }
.bg-info-soft { background: rgba(49, 130, 206, 0.12); }
.bg-danger-soft { background: rgba(229, 62, 62, 0.12); }

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}
