/* System Font Stack - Zero Bandwidth, Maximum Speed */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --c-black: #000000;
    --c-white: #FFFFFF;
    --c-gray: #F6F6F6;
    --c-gray-dark: #EEEEEE;
    --c-text: #000000;
    --c-text-light: #6B6B6B;
    --c-border: #E2E2E2;
    --success: #47B275;
    --warning: #FFC043;
    --danger: #E62C2C;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #FFFFFF;
    color: #000000;
    min-height: 100vh;
    line-height: 1.6;
    font-size: 16px; /* Compatibility Fallback */
    font-size: clamp(14px, 2vw, 16px);
}

/* Navbar */
.navbar {
    background: #000000;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5em;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.02em;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    width: 100%;
}

@media (min-width: 768px) {
    .container {
        margin: 40px auto;
        /* max-width remains 1200px from base style, but we can adjust padding if needed */
    }
}

/* Keep login form centered and narrow */
.login-form {
    max-width: 480px;
    margin: 0 auto;
    background: #FFFFFF;
    border-radius: 8px;
    padding: 32px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.4s ease;
}

.login-header {
    margin-bottom: 32px;
}

.icon-circle {
    display: none;
}

.login-header h2 {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--c-black);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.login-header p {
    color: var(--c-text-light);
    font-size: 1em;
    font-weight: 400;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.875em;
    font-weight: 500;
    color: var(--c-text);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 16px;
    background: var(--c-gray);
    border: none;
    border-radius: 4px;
    font-size: 1em;
    color: var(--c-text);
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus {
    outline: none;
    background: var(--c-gray-dark);
}

.form-group input::placeholder {
    color: var(--c-text-light);
}

.field-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    z-index: 2;
    display: flex;
    align-items: center;
}

.field-icon:hover {
    color: #666;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    min-height: 48px;
    background: var(--c-black);
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    color: var(--c-white);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background: #333333;
}

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

.btn-secondary {
    width: 100%;
    padding: 16px;
    min-height: 48px;
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    color: var(--c-black);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: var(--c-gray);
}


/* Loading Screen Styles (Merged) */
.loading {
    position: relative;
    overflow: hidden;
    background: linear-gradient(-45deg, #ffffff, #f0f0f0, #e6e6e6, #ffffff);
    background-size: 400% 400%;
    animation: slideUp 0.4s ease, gradientBG 15s ease infinite;
    border-radius: 8px;
    padding: 48px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

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

.loading-content {
    position: relative;
    z-index: 1;
}

.loading-content h3 {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--c-black);
    margin-bottom: 32px;
    letter-spacing: -0.02em;
}

/* Floating Particles */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.particle {
    position: absolute;
    display: block;
    list-style: none;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.03);
    animation: float 25s linear infinite;
    bottom: -150px;
    border-radius: 50%;
}

.particle:nth-child(1) {
    left: 25%;
    width: 80px;
    height: 80px;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    left: 10%;
    width: 20px;
    height: 20px;
    animation-delay: 2s;
    animation-duration: 12s;
}

.particle:nth-child(3) {
    left: 70%;
    width: 20px;
    height: 20px;
    animation-delay: 4s;
}

.particle:nth-child(4) {
    left: 40%;
    width: 60px;
    height: 60px;
    animation-delay: 0s;
    animation-duration: 18s;
}

.particle:nth-child(5) {
    left: 65%;
    width: 20px;
    height: 20px;
    animation-delay: 0s;
}

.particle:nth-child(6) {
    left: 75%;
    width: 110px;
    height: 110px;
    animation-delay: 3s;
}

.particle:nth-child(7) {
    left: 35%;
    width: 150px;
    height: 150px;
    animation-delay: 7s;
}

.particle:nth-child(8) {
    left: 50%;
    width: 25px;
    height: 25px;
    animation-delay: 15s;
    animation-duration: 45s;
}

.particle:nth-child(9) {
    left: 20%;
    width: 15px;
    height: 15px;
    animation-delay: 2s;
    animation-duration: 35s;
}

.particle:nth-child(10) {
    left: 85%;
    width: 150px;
    height: 150px;
    animation-delay: 0s;
    animation-duration: 11s;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
        border-radius: 0;
    }

    100% {
        transform: translateY(-1000px) rotate(720deg);
        opacity: 0;
        border-radius: 50%;
    }
}

/* Loading Icon with Pulse Rings */
.loading-icon {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 40px;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    opacity: 0;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

.pulse-ring.delay-1 {
    animation-delay: 0.6s;
    border-color: rgba(0, 0, 0, 0.2);
}

.pulse-ring.delay-2 {
    animation-delay: 1.2s;
    border-color: rgba(0, 0, 0, 0.3);
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.8);
        opacity: 0;
    }
}

/* Checkmark */
.checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    display: none;
    filter: drop-shadow(0 0 10px rgba(71, 178, 117, 0.4));
}

.checkmark.show {
    display: block;
}

.checkmark-circle {
    stroke: var(--success);
    stroke-width: 3;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    stroke: var(--success);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

/* Loading Subtitle */
.loading-subtitle {
    color: var(--c-text-light);
    font-size: 0.95em;
    margin-top: -20px;
    margin-bottom: 40px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Step Progress Indicators */
.steps-container {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    gap: 12px;
    position: relative;
    width: 100%;
}

.steps-container::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: var(--c-gray);
    z-index: 0;
}

.step {
    flex: 1;
    text-align: center;
    opacity: 0.4;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step.active {
    opacity: 1;
    transform: translateY(-2px);
}

.step.complete {
    opacity: 1;
}

.step-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--c-white);
    border: 2px solid var(--c-gray);
    color: var(--c-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.4s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.step.active .step-icon {
    background: var(--c-black);
    border-color: var(--c-black);
    color: var(--c-white);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    animation: bounce 0.6s ease;
}

.step.complete .step-icon {
    background: var(--success);
    border-color: var(--success);
    color: transparent;
    box-shadow: 0 0 10px rgba(71, 178, 117, 0.3);
    position: relative;
}

.step.complete .step-icon::after {
    content: '✓';
    color: var(--c-white);
    font-size: 1.2em;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

@keyframes bounce {

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

    50% {
        transform: scale(1.15);
    }
}

.step-label {
    font-size: 0.75em;
    color: var(--c-text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.step.active .step-label {
    color: var(--c-black);
}

/* Animated Dots */
.dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '';
    }

    40% {
        content: '.';
    }

    60% {
        content: '..';
    }

    80%,
    100% {
        content: '...';
    }
}

/* Status Messages */
.status-messages {
    margin-top: 28px;
    max-height: 140px;
    overflow-y: auto;
    text-align: left;
    padding: 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
}

.status-message {
    padding: 8px 0;
    font-size: 0.8em;
    color: var(--c-text);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    animation: slideInLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-message:last-child {
    border-bottom: none;
}

.status-message::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-text-light);
}

.status-message.success::before {
    background: var(--success);
    box-shadow: 0 0 8px rgba(71, 178, 117, 0.4);
}

.status-message.error::before {
    background: var(--danger);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

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

/* Progress Bar */
.progress-container {
    margin: 24px 0;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--c-gray);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--c-black);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-text {
    font-size: 1em;
    font-weight: 600;
    color: var(--c-black);
}

.progress-status {
    color: var(--c-text-light);
    font-size: 0.875em;
}

/* Results */
.results {
    animation: slideUp 0.4s ease;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 2em;
    font-weight: 700;
    color: var(--c-black);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.page-header p {
    color: var(--c-text-light);
    font-size: 1em;
}

.overall-card {
    background: #000000;
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 32px;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.overall-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

.overall-card * {
    color: #ffffff;
    position: relative;
    z-index: 1;
}

.overall-card h3 {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 32px;
    color: #ffffff;
    text-transform: none;
    letter-spacing: 0;
    text-align: left;
}

.stat-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 32px;
    margin-top: 0;
}

.stat-grid .stat-item {
    flex: 1 1 40%;
    margin-bottom: 20px;
}

.stat-item {
    text-align: left;
    position: relative;
}

.stat-value {
    font-size: 3em;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
    line-height: 1;
    color: #ffffff;
    -webkit-text-fill-color: initial;
    background: none;
    text-shadow: none;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.7;
    color: #ffffff;
    font-weight: 500;
    text-transform: none;
    /* Image shows "Total Classes" normal case */
    letter-spacing: 0;
}

.alert-message {
    padding: 16px 20px;
    background: #222222;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.9em;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
}

.alert-message span {
    color: #47B275;
}

/* Subjects Section */
.subjects-section {
    margin: 32px 0;
}

.subjects-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.subjects-header-bar .section-title {
    margin-bottom: 0;
}

.sort-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sort-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--c-text-light, #6B6B6B);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sort-chips {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sort-chip {
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #E2E8F0;
    padding: 6px 13px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.sort-chip:hover {
    background: #E2E8F0;
    color: #0F172A;
    border-color: #CBD5E1;
}

.sort-chip.active {
    background: #0F172A;
    color: #FFFFFF;
    border-color: #0F172A;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

@media (max-width: 600px) {
    .subjects-header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .sort-toolbar {
        width: 100%;
        justify-content: space-between;
    }
    .sort-chips {
        flex: 1;
        justify-content: flex-start;
        gap: 4px;
    }
    .sort-chip {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}

.section-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #000000;
    margin-bottom: 24px;
}

.subjects-list {
    column-count: 1;
    column-gap: 20px;
    margin-bottom: 30px;
}

.subject-card {
    background: #000000;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #1a1a1a;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    display: flex;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 20px;
    width: 100%;
    flex-direction: column;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: #444; /* Default */
    transition: width 0.2s ease;
}

.subject-card.success::before { background: #10b981; }
.subject-card.warning::before { background: #ef4444; }

.subject-card:hover {
    transform: translateY(-4px);
    border-color: #333;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.subject-card:hover::before {
    width: 8px;
}

.subject-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-left: 8px;
}

.subject-name {
    flex: 1;
    display: flex;
    flex-direction: column;
    color: #ffffff;
    line-height: 1.2;
    padding-right: 15px;
}

.name-code-line {
    font-size: 0.9em;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.name-title-line {
    font-size: 1.25em;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

.subject-percentage {
    font-size: 2em;
    font-weight: 800;
    white-space: nowrap;
    text-align: right;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.subject-percentage.success { color: #10b981; }
.subject-percentage.warning { color: #ef4444; }

.subject-details {
    margin: 0 0 16px;
    padding-left: 8px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.metric-item {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.8em;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 2px;
}

.metric-value {
    font-size: 1.15em;
    font-weight: 700;
    color: #eee;
}

.threshold-insights {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    padding: 14px;
    margin-top: 10px;
    margin-bottom: 20px;
}

.insight-row {
    font-size: 0.9em;
    font-weight: 500;
    margin-bottom: 6px;
}

.insight-row:last-child {
    margin-bottom: 0;
}

.insight-row.success { color: #10b981; }
.insight-row.warning { color: #ef4444; }

.last-updated {
    font-size: 0.85em;
    font-weight: 500;
    color: #888;
    margin-top: 12px;
}

.subject-footer-divider {
    margin: 15px 0 10px;
}

.divider-line {
    height: 1px;
    background: #333;
    margin-bottom: 3px;
    width: 100%;
}



/* Accordion Specifics */
.expand-hint {
    text-align: center;
    user-select: none;
    cursor: pointer;
    font-size: 0.85em;
    color: #888;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 500;
}

.expand-icon {
    transition: transform 0.3s ease;
    font-size: 0.8em;
}

.subject-card.expanded .expand-icon {
    transform: rotate(180deg);
}

.history-container {
    background-color: #0a0a0a;
    margin-top: 16px;
    border-radius: 8px;
    border: 1px solid #333;
    max-height: 290px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.history-content {
    padding: 0;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.history-table th {
    text-align: left;
    padding: 10px 8px;
    color: #888;
    background: #111;
    position: sticky;
    top: 0;
    z-index: 2;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
}

.history-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #222;
    color: #eee;
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) {
    width: 30%;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
    width: 45%;
}

.history-table th:nth-child(3),
.history-table td:nth-child(3) {
    width: 25%;
    text-align: right;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.status-badge.present {
    background-color: rgba(71, 178, 117, 0.15);
    color: var(--success);
}

.status-badge.absent {
    background-color: rgba(230, 44, 44, 0.15);
    color: var(--danger);
}


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

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

@keyframes shake {

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

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--c-text-light);
    font-size: 0.9em;
}

.actions {
    display: grid;
    gap: 16px;
    margin-top: 32px;
}

@media (min-width: 640px) {
    .actions {
        grid-template-columns: 1fr 1fr;
    }

    .subjects-list {
        column-count: 2;
        column-gap: 24px;
    }
}

@media (min-width: 1024px) {
    .subjects-list {
        column-count: 3;
    }
}

/* Form Error */
.form-error {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: var(--danger);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideUp 0.3s ease;
}

@media (max-width: 480px) {
    .loading-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 24px;
    }

    .pulse-ring {
        width: 50px;
        height: 50px;
    }

    .step-icon {
        width: 32px;
        height: 32px;
        font-size: 0.8em;
    }

    .step-label {
        font-size: 0.6em;
        letter-spacing: 0;
    }

    .steps-container {
        gap: 4px;
        margin: 24px 0;
    }

    .loading-content h3 {
        font-size: 1.2em;
        margin-bottom: 16px;
    }

    .loading-subtitle {
        font-size: 0.85em;
        margin-bottom: 24px;
    }

    .loading {
        padding: 32px 16px;
    }

    /* ── Subject card mobile fixes ── */
    .subject-card {
        padding: 18px 14px;
    }

    .subject-name {
        font-size: 0.95em;
    }
    
    .name-code-line {
        font-size: 1.05em;
    }

    .subject-percentage {
        font-size: 1.8em;
    }

    .subject-details {
        margin: 12px 0 8px;
    }

    .metrics-grid {
        gap: 12px;
        margin-bottom: 15px;
    }

    .metric-value {
        font-size: 1em;
    }

    .threshold-insights {
        padding: 10px;
        font-size: 0.85em;
    }
}
}

/* Ultra-small devices (< 380px) */
@media (max-width: 380px) {
    .subject-percentage {
        font-size: 1.5em;
    }

    .metrics-grid {
        grid-template-columns: 1fr; /* Stack all stats on tiny screens */
        gap: 8px;
    }
    
    .subject-header {
        margin-bottom: 12px;
    }

    .name-title-line {
        font-size: 1.1em;
    }
}


.history-container::-webkit-scrollbar {
    width: 6px;
}
.history-container::-webkit-scrollbar-track {
    background: #111111;
    border-radius: 4px;
}
.history-container::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 4px;
}
.history-container::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

/* SEO SECTION STYLES */
.seo-section {
    max-width: 800px;
    margin: 40px auto;
    padding: 50px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    color: #64748b;
    text-align: left;
    box-sizing: border-box;
}
.seo-section h2 {
    color: #0f172a;
    margin-top: 0;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: -0.02em;
}
.seo-section h3 {
    color: #0f172a;
    margin-top: 45px;
    margin-bottom: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.seo-section p {
    line-height: 1.7;
    font-size: 15px;
    margin-bottom: 25px;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}
.feature-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.feature-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}
.feature-icon {
    color: #3b82f6;
    margin-bottom: 16px;
    background: #eff6ff;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}
.feature-card h4 {
    margin: 0 0 8px 0;
    color: #0f172a;
    font-weight: 600;
    font-size: 15px;
}
.feature-card p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
}
details {
    border-bottom: 1px solid #e2e8f0;
    padding: 4px 0;
}
details:last-of-type {
    border-bottom: none;
}
summary {
    padding: 20px 0;
    font-weight: 500;
    color: #0f172a;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    transition: color 0.2s ease;
}
summary:hover {
    color: #3b82f6;
}
summary::-webkit-details-marker { display: none; }
summary::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 1.5px solid #64748b;
    border-bottom: 1.5px solid #64748b;
    transform: rotate(45deg);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}
details[open] summary::after {
    transform: rotate(-135deg);
    border-color: #3b82f6;
}
details[open] summary { color: #3b82f6; }
.faq-content {
    padding: 0 0 24px 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(-5px);
}
@keyframes slideDown {
    to { opacity: 1; transform: translateY(0); }
}

/* ERP Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.green {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
    animation: pulseDot 2s infinite;
}

.status-dot.yellow {
    background: #f59e0b;
    box-shadow: 0 0 6px #f59e0b;
}

.status-dot.red {
    background: #ef4444;
    box-shadow: 0 0 6px #ef4444;
}

@keyframes pulseDot {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* PWA Install Button */
.pwa-install-nav-btn {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.pwa-install-nav-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}
