/* ==========================================================================
   1. Core & Typography
   ========================================================================== */

:root {
    --color-background: #121212;
    --color-text-primary: #E0E0E0;
    --color-text-secondary: #C0C0C0;
    --color-text-disabled: #6c6c6c;
    --color-accent: #87CEEB;
    --color-accent-hover: #a0dffc;
    --color-accent-darker: #CBDCF8;
    --color-error: #FE4343;
    --color-surface: #2a2a2a;
    --color-border: rgba(224, 224, 224, 0.1);
    --font-primary: 'Lato', sans-serif;
    --font-code: 'Courier New', Courier, monospace;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    box-sizing: border-box;
}

h1 {
    font-size: 3.5em;
    text-shadow: 0 0 10px rgba(224, 224, 224, 0.5);
    margin-bottom: 25px;
    text-align: center;
    transition: color 0.4s ease-out, text-shadow 0.4s ease-out;
}

.wide-spacing {
    letter-spacing: 10px;
}

h2.section-header {
    font-size: 1.5em;
    font-weight: bold;
    padding: 10px 10px 0;
    margin: 20px 0;
    text-align: right;
}

code {
    background-color: var(--color-surface);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: var(--font-code);
}

/* ==========================================================================
   2. Layout & Containers
   ========================================================================== */

.main-container {
    width: 90%;
    max-width: 500px;
}

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

.announcement {
    text-align: center;
    font-size: 1em;
    color: var(--color-text-secondary);
    margin: -10px auto 25px auto;
    line-height: 1.5;
    max-width: 450px;
}

.section-subheader {
    text-align: right;
    margin: -10px 0 0 0;
    padding: 0 10px 0 0;
    font-size: 1em;
    color: var(--color-text-secondary);
}

/* ==========================================================================
   3. Components
   ========================================================================== */

/* --- Overlays (Intro & Easter Egg) --- */
#intro-overlay,
.easter-egg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-tap-highlight-color: transparent;
}

#intro-overlay {
    background-color: rgba(18, 18, 18, 0.8);
    z-index: 1000;
    cursor: pointer;
    opacity: 1;
    transition: opacity 1s ease-out, visibility 1s;
}

.easter-egg {
    background-color: rgba(12, 12, 12, 0.8);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease-in;
}

.easter-egg.visible {
    opacity: 1;
}

.easter-egg.fading-out {
    transition: opacity 1s ease-out;
}

#intro-overlay p {
    font-size: 1.5em;
}

.easter-egg p {
    font-size: 2em;
}

/* --- Link Sections --- */
.link-section {
    width: 100%;
    margin: 0 0 10px 0;
    padding: 0;
    list-style: none;
}

.link-section li {
    font-size: 1em;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: background-color 0.2s ease-out, text-shadow 0.3s ease-out, color 0.3s ease-out;
}

.link-section a {
    display: block;
    padding: 10px;
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease-out;
}

.link-section li.coming-soon {
    padding: 10px;
    color: var(--color-text-disabled);
    cursor: default;
}

/* Hover effects controlled by JavaScript via the .manual-hover class */
.link-section li.manual-hover {
    background-color: rgba(135, 206, 235, 0.05);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 1);
}

.link-section li.manual-hover a {
    color: var(--color-accent-darker);
    transform: translateY(-2px);
}

.link-section li.coming-soon.manual-hover {
    color: var(--color-text-primary);
}

/* Background image mask animation on hover */
.link-section li::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    background-image: linear-gradient(135deg, transparent 75%, var(--color-background) 90%), var(--bg-image);
    opacity: 0;
    mask-image: linear-gradient(to right, black 45%, transparent 55%, transparent 100%);
    mask-repeat: no-repeat;
    mask-size: 200% 100%;
    mask-position: 100% 0;
    transition: mask-position 0.4s ease-in-out, opacity 0.4s ease-out;
    z-index: -1;
}

.link-section li.manual-hover::before {
    opacity: 0.6;
    mask-position: 0% 0;
}

/* --- Mute Button --- */
#mute-button {
    background: none;
    border: none;
    cursor: pointer;
    margin-top: -5px;
    padding: 0 10px;
}

#mute-button svg {
    width: 20px;
    height: 20px;
    stroke: var(--color-text-secondary);
    transition: stroke 0.2s ease-out;
}

#mute-button:hover svg {
    stroke: var(--color-text-primary);
}

/* --- Asked Questions --- */
.aq-container {
    margin-top: -10px;
}

.aq-question {
    font-weight: bold;
    font-size: 1em;
    margin: 10px 0;
    text-align: justify;
}

.aq-answer {
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0 10px 25px 10px;
    font-size: 1em;
    text-align: justify;
}

.aq-answer p {
    margin: 0 0 10px 0;
}

.aq-answer a {
    color: var(--color-accent);
    text-decoration: none;
}

/* ==========================================================================
   4. Login Page & Forms (ADDED SECTION)
   ========================================================================== */

.login-heading {
    font-size: 3em;
    margin-top: 50px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.input-container {
    position: relative;
}

.login-form input {
    width: 100%;
    padding: 10px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 1em;
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    box-sizing: border-box;
}

.password-container input {
    padding-right: 40px; /* Space for the eye icon */
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    cursor: pointer;
    fill: var(--color-text-disabled);
    transition: fill 0.2s ease-out;
}

.password-toggle:hover {
    fill: var(--color-text-primary);
}

/* Hide default IE password reveal icon */
#password-input::-ms-reveal {
    display: none;
}

.login-form button,
#logout-button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease-out;
    color: var(--color-background);
}

.login-form button {
    background-color: var(--color-accent);
}

.login-form button:hover {
    background-color: var(--color-accent-hover);
}

#logout-button {
    background-color: var(--color-error);
}

#logout-button:hover {
    background-color: #ff6b6b;
}

.logged-in-message {
    text-align: center;
    font-size: 1em;
    color: var(--color-text-secondary);
    margin-top: 25px;
}

.user-email-display {
    text-align: center;
    font-size: 1em;
    font-weight: bold;
    margin: -10px 0 20px 0;
    word-break: break-all;
}

/* ==========================================================================
   5. Utility & Animation
   ========================================================================== */

.hidden {
    display: none;
}

.fade-out {
    opacity: 0 !important;
    visibility: hidden;
}

/* Flashes input border red on error */
.error-state input {
    border-color: var(--color-error) !important;
    animation: flash-red 0.5s ease-in-out;
}

@keyframes flash-red {
    0%, 100% { background-color: var(--color-surface); }
    25%, 75% { background-color: rgba(254, 67, 67, 0.2); }
}

/* Disables link interaction during easter egg cooldown */
body.cooldown-active .link-section li {
    pointer-events: none;
    cursor: default;
}

/* --- Speed Indicator --- */
#speed-indicator {
    position: fixed;
    top: 0;
    left: 0;
    padding: 5px 5px;
    background-color: rgba(18, 18, 18, 0.2);
    color: var(--color-text-primary);
    font-size: 1em;
    border-radius: 5px;
    z-index: 2;
    pointer-events: none;
    user-select: none;
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.1s ease-out, visibility 0.1s ease-out;
}

#speed-indicator.speed-visible {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   6. Page-Specific Styles (e.g., 404 Page)
   ========================================================================== */

.not-found-container {
    text-align: center;
}

.not-found-container h1 {
    font-size: 3em;
    margin-bottom: 25px;
}