:root {
    /* Base theme_disorganized Palette */
    --bg-main: rgb(33, 29, 43); /* clock background */
    --bg-panel: rgb(94, 58, 90); /* dark lavender */
    --text-primary: rgb(137, 220, 235); /* wifi blue */
    --text-secondary: rgb(206, 162, 253); /* changepaper lilac */
    
    /* Accents & Statuses */
    --border-accent: rgb(167, 192, 128); /* changepaper border green */
    --status-good: rgb(153, 214, 185); /* mint green (favorable) */
    --status-warn: rgb(223, 164, 109); /* status text orange */
    --status-crit: rgb(144, 39, 89); /* red purple */
    --hypr-blue: rgb(51, 204, 255);
    --hypr-green: rgb(0, 255, 153);
}

/* ~~~ GLOBAL FORMATTING ~~~ */
body {
    font-family: 'Courier New', Courier, monospace;
    color: var(--text-primary);
    background-color: var(--bg-main);
    margin: 0;
    padding: 20px;
}

h1, h2, h3 {
    color: var(--text-secondary);
    margin-top: 0;
    border-bottom: 1px solid var(--border-accent);
    padding-bottom: 10px;
}

a {
    color: var(--hypr-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--status-warn);
}

/* ~~~ LAYOUT CONTAINERS ~~~ */
main {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.info-panel {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-accent);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 30px;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.5);
}

/* ~~~ GLOBAL BANNER IMAGE ~~~ */
.banner-container {
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
}

.banner-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 2px solid var(--border-accent);
    box-sizing: border-box;
}

/* ~~~ BANNER & AVATAR ~~~ */
.student-progress-banner {
    display: flex;
    align-items: center;
    justify-content: space-between; 
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    gap: 30px;
    border: 2px solid var(--border-accent);
}

.avatar-section {
    flex: 0 0 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-main);
    border: 2px solid var(--border-accent);
    border-radius: 8px;
    overflow: hidden;
}

.default-avatar {
    color: var(--status-warn);
    text-align: center;
    margin: 0;
    font-size: 1.5em;
    word-wrap: break-word;
    border: none;
}

.custom-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ~~~ BADGE HACK ~~~ */
.badges-section {
    display: flex;
    flex: 1;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.badge img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: filter 0.3s ease;
}

.badge span {
    margin-top: 8px;
    font-size: 0.9em;
    font-weight: bold;
    color: var(--text-primary);
}

.badge.locked img {
    filter: grayscale(100%) opacity(0.3);
}

.badge.earned img {
    filter: grayscale(0%) opacity(1);
}

/* ~~~ RESPONSIVE STATS GRID ~~~ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: var(--bg-panel);
    border: 2px solid var(--border-accent);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.3);
}

.stat-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stat-card li {
    margin-bottom: 10px;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
}

.highlight-text {
    color: var(--status-warn);
    font-weight: bold;
}

/* ~~~ HISTORY PILLS ~~~ */
.history-container {
    margin-bottom: 40px;
    text-align: center;
}

.history-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 15px;
}

.history-pill {
    background-color: var(--bg-panel);
    color: var(--status-good);
    border: 1px solid var(--status-good);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1rem;
    min-width: 80px;
}

/* ~~~ HUD OVERRIDES ~~~ */
.game-hud {
    background: linear-gradient(135deg, rgb(20,20,25) 0%, var(--bg-main) 100%);
    padding: 20px 25px;
    border-left: 4px solid var(--hypr-blue);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
    margin-bottom: 30px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
}

.hud-title {
    font-size: 0.9em;
    color: var(--border-accent);
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-accent);
    padding-bottom: 5px;
}

.hud-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.hud-label {
    width: 140px;
    font-weight: 900;
    font-size: 1.1em;
    font-style: italic;
}

.hud-label.hp-text { color: var(--hypr-green); }
.hud-label.shield-text { color: var(--hypr-blue); }

.hud-track {
    flex-grow: 1;
    height: 22px;
    background-color: #0a0a0a;
    border: 1px solid #222;
    transform: skewX(-15deg);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.8);
}

.hud-fill {
    height: 100%;
    transition: width 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

.hud-value {
    width: 60px;
    text-align: right;
    font-weight: bold;
    font-size: 1.2em;
}

.shield-fill { background: linear-gradient(90deg, #005c8a 0%, var(--hypr-blue) 100%); }
.hp-true-green { background: linear-gradient(90deg, #0b8033 0%, var(--hypr-green) 100%); color: var(--hypr-green); }
.hp-light-green { background: linear-gradient(90deg, #4da333 0%, var(--status-good) 100%); color: var(--status-good); }
.hp-yellow-green { background: linear-gradient(90deg, #87941c 0%, #cddc39 100%); color: #cddc39; }
.hp-yellow { background: linear-gradient(90deg, #b89b14 0%, var(--status-warn) 100%); color: var(--status-warn); }
.hp-orange { background: linear-gradient(90deg, #b86214 0%, #f39c12 100%); color: #f39c12; }
.hp-red { background: linear-gradient(90deg, #990000 0%, var(--status-crit) 100%); color: var(--status-crit); }


/* ~~~ HP BAR READABILITY FIX ~~~ */
.hud-value {
    color: #ffffff !important;
    text-shadow: 
        2px 2px 0px #000, 
        -1px -1px 0px #000, 
        1px -1px 0px #000, 
        -1px 1px 0px #000,
        1px 1px 0px #000;
}

/* ~~~ DYNAMIC GRADE COLORS ~~~ */
.grade-red { color: var(--status-crit); font-weight: bold; }
.grade-orange { color: var(--status-warn); font-weight: bold; }
.grade-yellow { color: #f1c40f; font-weight: bold; }
.grade-green { color: var(--status-good); font-weight: bold; }

/* Animated Shimmering Dark Green for 90+ */
.grade-emerald {
    /* Uses your dark banner green and sweeps a bright mint green shine across it */
    background: linear-gradient(to right, #2c5236, #99d6b9, #1b3022, #99d6b9, #2c5236);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 900;
    text-shadow: none; 
    animation: emerald-sparkle 3s linear infinite;
}

@keyframes emerald-sparkle {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* ~~~ SCHEDULE LAYOUT ~~~ */
.schedule-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-accent);
}

.schedule-item:last-child {
    border-bottom: none;
}

.schedule-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.schedule-info strong {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.resource-link {
    font-size: 0.9rem;
    color: var(--hypr-blue);
    font-weight: bold;
}

.schedule-due {
    background-color: var(--bg-main);
    border: 1px solid var(--status-warn);
    color: var(--status-warn);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
}

/* ~~~ ASSIGNMENT TYPE TAGS ~~~ */
.type-tag {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: text-bottom;
    font-weight: 900;
    color: var(--bg-main); /* Deep background color for high contrast text */
}

.tag-cw { background-color: var(--hypr-blue); }
.tag-hw { background-color: var(--status-warn); }
.tag-lab { background-color: var(--text-secondary); }
.tag-test { background-color: var(--status-crit); }

/* ~~~ FILTERABLE TAGS ~~~ */
.type-tag.filterable {
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.type-tag.filterable:hover {
    opacity: 0.8;
}

.type-tag.filterable:active {
    transform: scale(0.95);
}

/* ~~~ HEADER STATS LAYOUT ~~~ */
.header-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
}

.header-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mp-end-date {
    color: var(--text-primary);
    font-weight: bold;
}

.stat-divider {
    color: var(--text-secondary);
}

/* Force stacked layout on phones */
@media (max-width: 600px) {
    .header-stats, .header-group {
        flex-direction: column;
        gap: 8px;
    }
    .stat-divider {
        display: none; /* Hides the pipe | on mobile */
    }
}

/* ~~~ PORTAL & 404 STYLES ~~~ */
.portal-container {
    max-width: 500px;
    margin: 80px auto;
    text-align: center;
}

.id-input {
    background-color: var(--bg-main);
    border: 2px solid var(--border-accent);
    color: var(--text-primary);
    padding: 15px;
    font-size: 1.2rem;
    font-family: 'Courier New', Courier, monospace;
    border-radius: 8px;
    width: 80%;
    margin-bottom: 20px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s ease;
}

.id-input:focus {
    border-color: var(--hypr-blue);
    box-shadow: 0 0 10px rgba(51, 204, 255, 0.2);
}

.id-input.input-error { border-color: var(--status-crit); }
.id-input.input-error:focus { border-color: var(--status-warn); box-shadow: 0 0 10px rgba(223, 164, 109, 0.2); }

.access-btn {
    background-color: var(--bg-panel);
    color: var(--status-good);
    border: 2px solid var(--status-good);
    padding: 12px 25px;
    font-size: 1.1rem;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.access-btn:hover { background-color: var(--status-good); color: var(--bg-main); }
.access-btn.btn-error { color: var(--status-warn); border-color: var(--status-warn); }
.access-btn.btn-error:hover { background-color: var(--status-warn); color: var(--bg-main); }

.error-code {
    font-size: 6rem;
    font-weight: 900;
    color: var(--status-crit);
    margin: 0;
    text-shadow: 4px 4px 0px rgba(0,0,0,0.5);
}

/* ~~~ OVERHAULED MODULAR FOOTER ~~~ */
footer {
    margin-top: 80px;
    border-top: 1px dashed var(--border-accent);
    padding-top: 40px; /* Top spacing from dashed line */
    text-align: center;
}

.footer-content {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 40px;
    text-align: left;
}

.footer-section {
    flex: 1 1 300px;
}

.footer-section h3 {
    color: var(--text-primary);
    margin-bottom: 25px;
    padding-bottom: 40px; /* Perfectly balances the 40px padding-top of the footer */
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.resource-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.resource-links a {
    background-color: var(--bg-panel);
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid var(--border-accent);
    font-weight: bold;
}

.footer-bottom {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid var(--bg-panel);
    color: var(--border-accent);
    font-style: italic;
    font-weight: bold;
}
