/* --- VARIABLES --- */
:root {
    --primary: #4f46e5;
    --primary-soft: rgba(79, 70, 229, 0.1);
    --text-main: #0f172a;
    --text-sub: #64748b;
    --bg-body: #f0f4f8;
    /* Slightly darker for contrast with glass */
    --surface: #ffffff;
    /* Solid background */
    --border: #e2e8f0;
    /* Light border */
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --nav-height: 70px;
    --error: #ef4444;
    --error-bg: rgba(254, 242, 242, 0.5);
    --success: #10b981;
    --warning: #f59e0b;
    --disabled: #cbd5e1;
    --glass-blur: blur(12px);
}

[data-theme="dark"] {
    --primary: #818cf8;
    --primary-soft: rgba(99, 102, 241, 0.15);
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --bg-body: #0f172a;
    --surface: #1e293b;
    /* Dark navbar background */
    --border: rgba(255, 255, 255, 0.05);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --error-bg: rgba(239, 68, 68, 0.1);
    --disabled: #475569;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-body);
    /* Simple solid background – no heavy gradients for better contrast */
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}



/* --- NAVBAR --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: var(--surface);
    /* Navbar background follows theme */
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    height: 100%;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-sub);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 10px;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

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

.icon-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-main);
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: transform 0.1s, background 0.2s;
}

.icon-btn:active {
    transform: scale(0.9);
    /* Keep subtle click feedback */
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-btn {
    display: none;
    font-size: 1.5rem;
    color: var(--text-main);
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
}

.menu-btn:active {
    transform: scale(0.9);
}

.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

/* --- MOBILE MENU --- */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: var(--surface);
    /* Mobile menu background follows theme */
    z-index: 200;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
}

.mobile-menu.open {
    transform: translateX(0);
}

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(4px);
}

.menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.mm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: transparent;
}

.mm-close-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mm-close-btn:active {
    transform: scale(0.9);
}

.mm-links {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mm-link {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-sub);
    text-decoration: none;
    padding: 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.mm-link:active {
    transform: scale(0.98);
}

.mm-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.mm-link.active {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary);
}

/* --- MAIN CONTENT --- */
.main-content {
    margin-top: var(--nav-height);
    flex: 1;
    padding: 30px 20px;
    max-width: 900px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.view-section.active {
    display: block;
}

.section-header {
    margin-bottom: 30px;
    text-align: center;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.section-subtitle {
    color: var(--text-sub);
    font-size: 1rem;
}

/* --- CARDS & UI --- */
.card {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 24px;
    transition: transform 0.2s;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ch-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
}

.card-body {
    padding: 24px;
}

input,
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    /* Glassy inputs */
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: 0.2s;
    font-family: inherit;
    appearance: none;
    height: 48px;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
    background: var(--surface);
    transform: scale(1.01);
}

input.error {
    background: var(--error-bg);
    border-color: var(--error);
    animation: shake 0.4s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: block;
}

.data-row {
    display: grid;
    gap: 16px;
    align-items: end;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 16px;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    transition: transform 0.2s, background 0.2s;
}

.data-row:hover {
    background: rgba(255, 255, 255, 0.1);
}

.row-marks {
    grid-template-columns: 1fr 1fr;
}

.row-gpa {
    grid-template-columns: 2fr 1fr 1fr 40px;
}

.del-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--error);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.1s;
}

.del-btn:active {
    transform: scale(0.9);
}

.del-btn:hover {
    background: var(--error);
    color: #fff;
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.btn {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.1s, box-shadow 0.2s;
}

.btn:active {
    transform: scale(0.95);
}

.btn-sec {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid var(--border);
    backdrop-filter: blur(5px);
}

.btn-sec:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-pri {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 20px -5px var(--primary-soft);
}

.btn-pri:hover {
    box-shadow: 0 15px 25px -5px var(--primary-soft);
    transform: translateY(-2px);
}

.btn-pri:active {
    transform: scale(0.95) translateY(0);
}

.btn-pri:disabled {
    background: var(--disabled);
    color: #fff;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
    transform: none;
}

.btn-error {
    background: var(--error) !important;
    color: #fff !important;
    animation: shake 0.4s;
}

.result-card {
    background: var(--primary-soft);
    border: 1px solid var(--primary);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    margin-top: 30px;
    display: none;
    animation: slideUp 0.3s;
    backdrop-filter: blur(10px);
}

.res-val {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.res-lbl {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* Table */
.table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    text-align: left;
    font-size: 0.75rem;
    color: var(--text-sub);
    text-transform: uppercase;
}

td {
    padding: 12px;
    border-top: 1px solid var(--border);
    color: var(--text-main);
    vertical-align: middle;
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-block;
}

.b-safe {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.b-warn {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.b-crit {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.b-needs-min {
    background: #575757;
    color: #fff !important;
    font-weight: 700;
}

.att-ind-status {
    grid-column: 1 / -1;
    margin-top: 12px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    display: none;
}

.att-ind-status.show {
    display: block;
    animation: fadeIn 0.2s;
}

.status-safe {
    background: rgba(220, 252, 231, 0.8);
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-crit {
    background: rgba(254, 226, 226, 0.8);
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* HYDRAULIC ENGINE CSS */
.lock-toggle {
    width: 50px;
    height: 30px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.1rem;
}

.lock-toggle.open {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-sub);
    border: 1px solid var(--border);
}

.lock-toggle.locked {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px var(--primary-soft);
    transform: scale(1.05);
}

.hydro-row {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 12px;
    position: relative;
    transition: transform 0.2s;
}

.hydro-row.pulse-up {
    animation: pulseGreen 0.4s;
}

.hydro-row.pulse-down {
    animation: pulseRed 0.4s;
}

.hydro-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.hydro-sub-name {
    font-weight: 700;
    font-size: 0.95rem;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-main);
}

.hydro-grade-badge {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
    min-width: 40px;
    text-align: right;
}

.hydro-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 10px;
    outline: none;
    transition: background 0.3s ease;
}

.hydro-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.15s ease, left 0.3s ease;
}

.hydro-slider::-webkit-slider-thumb:active {
    transform: scale(1.2);
}

.hydro-row.sub-locked {
    opacity: 0.7;
    border-color: var(--disabled);
}

.hydro-row.sub-locked .hydro-slider {
    pointer-events: none;
    filter: grayscale(1);
}

.sub-lock-btn {
    color: var(--text-sub);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    transition: transform 0.1s;
}

.sub-lock-btn:active {
    transform: scale(0.9);
}

.sub-lock-btn.active {
    color: var(--text-main);
}

/* Hide Delete Button in Locked Mode */
#hydro-container.locked-mode .del-btn {
    display: none;
}

.target-input {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    width: 160px;
    border: none;
    background: transparent;
    text-align: center;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.target-input:focus {
    border-bottom-color: var(--primary);
    box-shadow: none;
    outline: none;
}

.target-input:read-only {
    opacity: 0.5;
    cursor: not-allowed;
    border-bottom: none;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
    color: transparent !important;
    pointer-events: none;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes pulseGreen {
    0% {
        transform: scale(1);
        border-color: var(--border);
    }

    50% {
        transform: scale(1.02);
        border-color: var(--success);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes pulseRed {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
        border-color: var(--error);
    }

    75% {
        transform: translateX(5px);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- HISTORY UI --- */
.history-item {
    margin-bottom: 20px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-date {
    font-size: 0.85rem;
    color: var(--text-sub);
    font-weight: 600;
}

.history-summary {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
}

.history-actions {
    display: flex;
    gap: 10px;
}

.history-actions .btn {
    flex: 1;
    font-size: 0.9rem;
    padding: 10px 16px;
}

.history-empty-state {
    text-align: center;
    padding: 80px 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Notification animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUpMobile {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes fadeOutMobile {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

@keyframes slideInDownMobile {
    from {
        opacity: 0;
        transform: translate(-50%, -150%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeOutMobileTop {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    to {
        opacity: 0;
        transform: translate(-50%, -150%);
    }
}



/* --- SESSION VIEW MODAL --- */
.session-view-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.session-view-modal {
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideInUp 0.3s ease-out;
}

.session-view-body h3 {
    margin: 0 0 8px 0;
    color: var(--text-main);
}

.session-meta {
    color: var(--text-sub);
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border);
}

.view-subject-card {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.view-subject-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.view-field-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.view-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--surface);
    border-radius: 6px;
}

.field-label {
    color: var(--text-sub);
    font-size: 0.9rem;
    font-weight: 500;
}

.field-value {
    color: var(--text-main);
    font-weight: 600;
}

.view-result-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark, var(--primary)) 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.result-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 800;
}

/* Footer */
/* Footer */
footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 40px 20px;
    margin-top: auto;
    text-align: center;
}

.f-links {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.f-link {
    color: var(--text-sub);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.f-link:hover {
    color: var(--primary);
}

.legal-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #b45309;
    padding: 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin: 0 auto 20px;
    max-width: 600px;
    line-height: 1.6;
}

[data-theme="dark"] .legal-box {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

/* Ads */
.ad-box {
    margin-top: 30px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Removed min-height, background, and border to hide when empty */
    overflow: hidden;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: var(--surface);
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    transform: scale(0.95);
    transition: transform 0.2s;
    position: relative;
}

.modal-overlay.open .modal-box {
    transform: scale(1);
}

.modal-close-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-body);
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 1.2rem;
}

.modal-h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-main);
}

.modal-p {
    color: var(--text-sub);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 24px;
    text-align: center;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }

    .menu-btn {
        display: block;
    }

    .row-marks,
    .row-gpa {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .btn-group {
        flex-direction: column;
    }

    .desktop-table {
        display: none;
    }

    .mobile-header-icons {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mob-res-card {
        background: var(--bg-body);
        border: 1px solid var(--border);
        border-radius: 16px;
        margin-bottom: 16px;
        overflow: hidden;
    }

    .mob-res-header {
        background: var(--surface);
        padding: 16px;
        font-weight: 700;
        border-bottom: 1px solid var(--border);
        display: flex;
        justify-content: space-between;
        color: var(--text-main);
    }

    .mob-res-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 16px;
        background: var(--surface);
    }

    .res-cell {
        text-align: center;
        padding: 8px;
        border-radius: 8px;
        background: var(--bg-body);
        border: 1px solid var(--border);
    }

    .res-cell-lbl {
        font-size: 0.7rem;
        color: var(--text-sub);
        margin-bottom: 6px;
        text-transform: uppercase;
        font-weight: 700;
    }

    /* Fix table scrolling for Mobile */
    #planner-result-section .table-wrap {
        overflow-x: visible;
    }

    #planner-result-section table {
        table-layout: fixed;
        width: 100%;
        min-width: 0;
    }

    #planner-result-section th,
    #planner-result-section td {
        padding: 10px 5px;
        font-size: 0.9rem;
    }

    /* Column 1: Subject (Wraps text) */
    #planner-result-section th:nth-child(1),
    #planner-result-section td:nth-child(1) {
        width: 50%;
        white-space: normal;
        word-break: break-word;
    }

    /* Column 2 & 3: Grade & Points */
    #planner-result-section th:nth-child(2),
    #planner-result-section td:nth-child(2),
    #planner-result-section th:nth-child(3),
    #planner-result-section td:nth-child(3) {
        width: 25%;
        text-align: center;
    }
}

@media (min-width: 769px) {
    .mobile-res-cards {
        display: none;
    }
}

/* --- 1. BROADCAST MODAL OVERLAY --- */
.bc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    /* Darker, modern overlay */
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 15px;
    /* Prevent touching screen edges on mobile */
    opacity: 0;
    transition: opacity 0.3s ease;
    /* Smooth fade in/out */
}

/* Class to trigger fade in */
.bc-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* --- 2. MODAL BOX CONTAINER --- */
.bc-box {
    background: #ffffff;
    width: 100%;
    max-width: 450px;
    max-height: 85vh;
    /* Never go taller than 85% of screen */
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    /* Stacks Header, Body, Footer */
    position: relative;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy pop-in */
}

.bc-overlay.active .bc-box {
    transform: scale(1);
}

/* --- 3. HEADER (Icon + Title) --- */
.bc-header {
    padding: 30px 30px 10px 30px;
    /* Top padding */
    text-align: center;
    flex-shrink: 0;
    /* Never shrink */
}

.bc-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 15px;
}

.bc-box h2 {
    color: #0f172a;
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* --- 4. SCROLLABLE CONTENT AREA --- */
.bc-scroll-area {
    padding: 10px 30px 20px 30px;
    overflow-y: auto;
    /* Scroll if text is long */
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: center;
    /* Scrollbar styling for Webkit */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.bc-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.bc-scroll-area::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

/* --- 5. FOOTER (Button) --- */
.bc-footer {
    padding: 0 30px 30px 30px;
    /* Bottom padding */
    flex-shrink: 0;
    /* Keeps button fixed at bottom */
}

.bc-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    color: white;
    background: #0f172a;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.bc-btn:active {
    transform: scale(0.98);
}

.bc-btn:hover {
    opacity: 0.9;
}

/* --- 6. THEMES --- */
.bc-type-alert .bc-icon {
    background: #fef2f2;
    color: #ef4444;
}

.bc-type-alert .bc-btn {
    background: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.bc-type-info .bc-icon {
    background: #e0e7ff;
    color: #4f46e5;
}

.bc-type-info .bc-btn {
    background: #4f46e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.bc-type-success .bc-icon {
    background: #dcfce7;
    color: #10b981;
}

.bc-type-success .bc-btn {
    background: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* --- 7. RESPONSIVE GREETING BANNER --- */
.greet-bar {
    background: linear-gradient(135deg, #4f46e5 0%, #818cf8 100%);
    color: white;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 50;
}

.greet-text-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: 1;
}

/* --- 8. MOBILE OPTIMIZATIONS --- */
@media (max-width: 480px) {

    /* Modal: Tighter padding on mobile to show more text */
    .bc-header {
        padding: 25px 20px 10px 20px;
    }

    .bc-scroll-area {
        padding: 10px 20px 20px 20px;
        font-size: 0.9rem;
    }

    .bc-footer {
        padding: 0 20px 25px 20px;
    }

    .bc-box {
        max-height: 80vh;
    }

    /* Leave space for browser bars */
    /* Greeting: Stack text on very small screens */
    .greet-text-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .greet-bar {
        align-items: flex-start;
    }
}

@keyframes zoomIn {
    to {
        transform: scale(1);
    }
}

/* --- TOAST NOTIFICATION --- */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--surface);
    color: var(--text-main);
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    font-size: 0.95rem;
    font-weight: 600;
    animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 320px;
}

.notification.hiding {
    animation: fadeOutRight 0.3s forwards;
}

/* --- CUSTOM CONFIRMATION MODAL --- */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.confirm-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.confirm-card {
    background: var(--surface);
    width: 90%;
    max-width: 450px;
    /* Wider for PC */
    text-align: center;
    padding: 32px;
    /* More padding for PC */
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: scale(0.9);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-overlay.active .confirm-card {
    transform: scale(1);
}

/* --- KEYFRAMES --- */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInBottom {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes fadeOutRight {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes fadeOutBottom {
    to {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
}

/* --- RESPONSIVE POLISH --- */
@media (max-width: 480px) {

    /* Mobile Toast: Float Bottom Center */
    .notification {
        bottom: 24px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
        justify-content: center;
        animation: slideInBottom 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .notification.hiding {
        animation: fadeOutBottom 0.3s forwards;
    }

    /* Mobile Confirm Card */
    .confirm-card {
        max-width: 320px;
        /* Restore smaller width for mobile */
        padding: 24px;
    }

    /* Adjust margins for detail view */
    .view-field-list {
        gap: 4px !important;
        font-size: 0.85rem;
    }

    .view-field {
        padding: 8px 4px !important;
    }

    .view-subject-header strong {
        font-size: 0.95rem;
        /* Slightly smaller header on mobile */
    }
}

/* --- HISTORY CARD POLISH --- */
.h-card-MARKS {
    border-left: 4px solid var(--primary) !important;
    background: linear-gradient(to right, rgba(79, 70, 229, 0.05), var(--surface));
}

.h-card-GPA {
    border-left: 4px solid var(--warning) !important;
    background: linear-gradient(to right, rgba(245, 158, 11, 0.05), var(--surface));
}

.h-card-CGPA {
    border-left: 4px solid #8b5cf6 !important;
    /* Purple */
    background: linear-gradient(to right, rgba(139, 92, 246, 0.05), var(--surface));
}

/* Ensure desktop table is hidden on mobile */
@media (max-width: 768px) {
    .desktop-table {
        display: none !important;
    }
}

/* --- SEO & ABOUT SECTION --- */
.about-section {
    margin-top: 60px;
    margin-bottom: 60px;
    animation: fadeIn 0.5s ease-out;
}

.about-header {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 20px;
    text-align: center;
}

.about-sub-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.about-sub-title i {
    color: var(--primary);
}

.about-text {
    margin-bottom: 16px;
    line-height: 1.7;
    color: var(--text-sub);
    font-size: 1rem;
}

.about-list {
    padding-left: 20px;
    margin-bottom: 24px;
    color: var(--text-sub);
    line-height: 1.7;
    list-style-type: none;
}

.about-list li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 25px;
}

.about-list li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2em;
    position: absolute;
    left: 0;
    top: -2px;
}

.about-note {
    font-size: 0.9rem;
    color: var(--text-sub);
    border-top: 1px solid var(--border);
    padding-top: 20px;
    margin-top: 30px;
    font-style: italic;
    background: var(--surface);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* --- MATH DISPLAY (Simulated LaTeX) --- */
@import url('https://fonts.googleapis.com/css2?family=Computer+Modern+Serif:ital,wght@0,400;0,700;1,400&display=swap');

/* --- MATH DISPLAY (Premium LaTeX Style) --- */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,700;1,400&display=swap');

.math-display {
    font-family: 'Crimson Pro', serif;
    font-size: 1.3rem;
    /* Slightly larger for readability */
    display: flex;
    align-items: center;
    /* justify-content: center; Removed to fix overflow cutoff */
    flex-wrap: nowrap;
    /* Prevent breaking */
    gap: 8px;
    padding: 20px 10px;
    color: var(--text-main);
    overflow-x: auto;
    /* Enable scrolling on small screens */
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Scrollbar hiding for cleaner look */
.math-display::-webkit-scrollbar {
    height: 8px;
}

.math-display::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.math-display::-webkit-scrollbar-thumb {
    background: var(--text-sub);
    border-radius: 4px;
}

.math-var {
    font-style: italic;
    font-weight: 500;
}

.math-sub {
    font-size: 0.7em;
    vertical-align: sub;
    margin-left: 1px;
    font-style: normal;
    color: var(--text-sub);
}

.math-op {
    margin: 0 6px;
    color: var(--primary);
    /* Accent color for operators */
    font-weight: 400;
}

.math-fraction {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    margin: 0 8px;
    font-size: 1rem;
}

.math-num {
    border-bottom: 2px solid var(--text-main);
    padding-bottom: 4px;
    text-align: center;
    width: 100%;
    display: block;
}

.math-den {
    padding-top: 4px;
    text-align: center;
    width: 100%;
    display: block;
}

.math-sigma {
    font-size: 1.4em;
    margin-right: 4px;
    color: var(--text-main);
}

/* Override existing formula box content style for better math layout */
.formula-box .formula-content {
    background: var(--bg-body);
    border-top: 1px solid var(--border);
}

.formula-box code {
    display: none;
    /* Hide old code block */
}

/* --- MODERN RESULTS UI --- */
.res-modern-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.res-modern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.res-modern-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
}

.res-modern-score {
    background: rgba(var(--primary), 0.1);
    /* Fallback if var not working directly */
    background: var(--bg-body);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
}

.res-modern-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Force 3 columns for mobile (O, A+, A) then (B+, B, Pass) */
    gap: 12px;
}

@media (min-width: 600px) {
    .res-modern-grid {
        grid-template-columns: repeat(6, 1fr);
        /* All in one row for tablet+ */
    }
}

.res-target-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-body);
    padding: 12px 6px;
    border-radius: 12px;
    border: 1px solid transparent;
    /* default border */
    position: relative;
    justify-content: space-between;
    height: 100%;
}

.res-target-grade-badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.res-target-val {
    font-weight: 800;
    font-size: 1.1rem;
}

/* --- NEW UNIFIED RESULT CARD DESIGN (Smart Card) --- */

/* The Container for all results */
#results-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    /* Responsive Grid */
    gap: 20px;
    margin-top: 20px;
    justify-content: center;
}

/* The Individual Subject Card */
.res-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    /* Using standard shadow var fallback */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.res-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.15);
}

/* Header: Subject Name & Score */
.res-header {
    padding: 20px;
    background: linear-gradient(to right, rgba(79, 70, 229, 0.05), var(--surface));
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.res-sub-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.res-score-badge {
    background: var(--primary);
    color: white;
    padding: 6px 14px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px -3px rgba(79, 70, 229, 0.3);
    /* Fallback for primary-soft */
}

/* Internal Marks Visual Bar */
.res-progress-track {
    height: 6px;
    background: var(--bg-body);
    width: 100%;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.res-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    transition: width 0.5s ease-out;
}

/* The Grid of Targets (O, A+, A...) */
.res-targets-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 items per row */
    gap: 12px;
}

/* Individual Target Box */
.res-target-box {
    background: var(--bg-body);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    border: 1px solid transparent;
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.res-target-grade {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-sub);
    margin-bottom: 4px;
    display: block;
}

.res-target-val {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    display: block;
}

/* Status Colors - Overriding previous if checking specifically for Smart Card Context */
.res-target-box.status-safe {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.res-target-box.status-warn {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.2);
}

.res-target-box.status-imp {
    background: rgba(239, 68, 68, 0.1);
    /* Red background */
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.2);
    opacity: 1;
    /* Reset opacity so it's visible */
}

.res-target-box.status-imp .res-target-val {
    color: var(--error);
    font-size: 0.9rem;
    font-weight: 700;
}

.min-badge {
    font-size: 0.6rem;
    background: var(--warning);
    color: #fff;
    padding: 2px 4px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 4px;
}

/* Mobile Tweak: Ensure 3 columns fit */
@media (max-width: 400px) {
    .res-targets-grid {
        gap: 8px;
    }

    .res-target-val {
        font-size: 1rem;
    }
}

/* Status Colors for Values */
.status-done {
    color: var(--success);
    font-size: 1.4rem;
}

.status-safe {
    color: var(--text-main);
}

.status-warn {
    color: var(--warning);
}

.status-crit {
    color: var(--error);
}

.status-imp {
    color: var(--text-sub);
    opacity: 0.5;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: auto;
    margin-bottom: auto;
}

.status-safe {
    color: var(--text-main);
}

.status-warn {
    color: var(--warning);
}

.status-crit {
    color: var(--error);
}

.status-imp {
    color: var(--text-sub);
    opacity: 0.5;
    text-decoration: line-through;
}

.academic-guides-section {
    margin-top: 50px;
    border-top: 1px solid var(--border);
    padding-top: 40px;
}

.guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.guide-card {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.guide-card .card {
    height: 100%;
    /* For nested structure if needed, or if we apply .guide-card to the A tag */
    transition: transform 0.2s;
}

.guide-card:hover {
    transform: translateY(-5px);
}

.guide-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.guide-card .ch-title {
    margin-bottom: 12px;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.guide-card:hover .ch-title {
    color: var(--primary);
}

/* --- FORMULA BOX (World Class Design) --- */
.formula-box {
    margin-top: 25px;
    margin-bottom: 10px;
    width: 100%;
}

.formula-box details {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    position: relative;
}

.formula-box details[open] {
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-soft);
}

.formula-box summary {
    padding: 14px 20px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    font-size: 0.9rem;
    user-select: none;
    transition: background 0.2s;
}

.formula-box summary:hover {
    color: var(--primary);
    background: rgba(var(--primary), 0.02);
}

.formula-box summary::-webkit-details-marker {
    display: none;
}

/* Custom Icon for Summary */
.formula-box summary::after {
    content: '';
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.formula-box details[open] summary::after {
    transform: rotate(180deg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.formula-box summary::before {
    content: 'Math Model';
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    font-weight: 800;
    color: var(--text-sub);
    opacity: 0.6;
    margin-right: auto;
}

/* Hide the old text, show the new label via pseudo-element or just style existing */
/* Actually, let's keep the existing text but style it nicely */

.formula-content {
    padding: 0 20px 20px 20px;
    font-size: 0.95rem;
    color: var(--text-main);
    animation: slideDown 0.3s ease-out;
    border-top: 1px dashed var(--border);
    margin-top: 0;
    padding-top: 20px;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.formula-note {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-top: 15px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.05);
    /* Warning tint */
    border-radius: 8px;
    border-left: 3px solid var(--warning);
}

/* --- RICH STAT CARDS (GPA/CGPA) --- */
.rich-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0;
    /* Let children handle padding */
    overflow: hidden;
    text-align: center;
    max-width: 400px;
    margin: 40px auto 0 auto;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.rich-stat-header {
    background: linear-gradient(135deg, var(--primary), #4338ca);
    color: white;
    padding: 15px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.rich-stat-card.theme-accent .rich-stat-header {
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
}

.rich-stat-body {
    padding: 30px;
}

.rich-stat-value {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-main);
    margin-bottom: 5px;
    background: -webkit-linear-gradient(var(--text-main), var(--text-sub));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rich-stat-label {
    font-size: 1.1rem;
    color: var(--text-sub);
    font-weight: 600;
}

.rich-stat-meta {
    margin-top: 15px;
    display: inline-block;
    background: var(--bg-body);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-sub);
    font-weight: 700;
}