/* global.css */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;700&display=swap');

html { scroll-behavior: smooth; }

:root {
    --primary-accent: #e56b55;
    --primary-accent-hover: #c44933;
    --text-dark: #f4ecd8;
    --text-light: #f4ecd8;
    --border-color: rgba(255, 255, 255, 0.2);
    --bg-overlay: rgba(20, 15, 10, 0.65); /* Slightly darker for better text contrast */
    --card-bg: rgba(25, 20, 15, 0.75);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --font-family: 'IBM Plex Mono', 'Courier New', monospace;
    --transition-speed: 0.3s;
}

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

body {
    background-color: #0d0d0d;
    background: url('../assets/bg_image.jpeg') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-light);
    font-family: var(--font-family);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Semi-transparent dark overlay to make text pop against background */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-overlay);
    z-index: -2;
}



/* Glassmorphism + Neobrutalism Card Style */
.glass-brutalist-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}




.glass-brutalist-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* Typography */
h1, h2, h3, h4 { font-weight: 700; text-transform: uppercase; letter-spacing: 2px; }
a { color: var(--primary-accent); text-decoration: none; transition: color var(--transition-speed); }
a:hover { color: #fff; }

/* Layout Elements */
.header { text-align: center; padding: 2rem 1rem; margin: 2rem auto; width: 90%; max-width: 800px; }
.header h1 { font-size: clamp(1.8rem, 1rem + 3vw, 2.5rem); margin-bottom: 0.5rem; text-shadow: 2px 2px 0px rgba(0,255,204,0.3); }
.header h2 { font-size: 1.2rem; color: #aaa; }

.container { display: flex; justify-content: center; align-items: center; flex: 1; padding: 2rem; flex-direction: column; width: 100%; }

/* Ensure text inside tests has appropriate contrast */
.quiz-container {
    width: 90%;
    max-width: 800px;
    padding: 2rem;
    margin: 2rem auto;
    background: rgba(10, 10, 10, 0.85); /* Dark solid background for readability */
    color: #e0e0e0;
}
.quiz-container h3 {
    margin-bottom: 1rem;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}
.options-list li {
    background: rgba(255,255,255,0.05);
    margin: 0.5rem 0;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: background 0.2s;
}
.options-list li:hover {
    background: rgba(255,255,255,0.1);
}

/* Buttons */
.btn-3d {
    display: inline-block; padding: 12px 24px;
    background: transparent; color: var(--primary-accent);
    border: 1px solid var(--border-color);
    font-family: var(--font-family); font-weight: bold; font-size: 1rem;
    text-transform: uppercase; letter-spacing: 1px;
    cursor: pointer; position: relative; transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-top: 1rem;
}
.btn-3d:hover { transform: translateY(2px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); background: rgba(0, 255, 204, 0.1); }
.btn-3d:active { transform: translateY(2px); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); }

/* Drawer Styling (Uniform across app) */
.drawer-toggle {
    position: fixed; top: 1rem; left: 1rem; z-index: 1000;
    background: rgba(0,0,0,0.5); color: var(--primary-accent); border: 1px solid var(--border-color);
    width: 50px; height: 50px; font-size: 1.5rem; cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); transition: all 0.2s;
    border-radius: 8px;
}
.drawer-toggle:hover { transform: translate(2px, 2px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); background: rgba(0, 255, 204, 0.1); }

.drawer {
    position: fixed; top: 0; left: -300px; width: 300px; height: 100vh;
    background: rgba(10, 10, 10, 0.95); backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-right: 2px solid var(--border-color); z-index: 1001;
    transition: left 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex; flex-direction: column; padding: 4rem 2rem 2rem;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    overflow-y: auto;
}
.drawer.is-open { left: 0; }
.drawer-close {
    position: absolute; top: 1rem; right: 1rem;
    background: none; border: none; color: var(--text-light); font-size: 2rem;
    cursor: pointer; transition: color 0.3s;
}
.drawer-close:hover { color: var(--primary-accent); transform: rotate(90deg); }
.drawer a {
    font-size: 1.1rem; font-weight: bold; text-transform: uppercase;
    margin-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem;
    transition: padding-left 0.2s, border-bottom-color 0.2s, color 0.2s;
}
.drawer a:hover { padding-left: 10px; border-bottom-color: var(--primary-accent); color: #fff; }

.footer { text-align: center; padding: 1.5rem; margin-top: auto; border-top: 1px solid var(--border-color); max-width: 800px; margin: auto; margin-bottom: 20px;}

/* General Animations */
.animated-component {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFadeIn 0.8s ease-out forwards;
}

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

/* Ensure inputs are legible */
input {
    width: 100%; padding: 12px; margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.6); color: var(--text-light);
    border: 1px solid var(--border-color); font-family: var(--font-family);
    transition: border-color var(--transition-speed);
    border-radius: 4px;
}
input:focus { outline: none; border-color: var(--primary-accent); }

/* Global Responsive Design Utilities */
@media screen and (max-width: 768px) {
    /* General card spacing */
    .glass-brutalist-card {
        padding: 1rem !important;
        margin: 1rem auto !important;
        width: 95% !important;
    }

    /* Container generic fallback scaling */
    .container {
        padding: 1rem !important;
    }

    /* Header text responsive scaling */
    .header h1 {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
    }

    .header h2 {
        font-size: 1rem !important;
    }

    /* Adjust padding of buttons for touch targets */
    .btn-3d {
        padding: 10px 16px !important;
        font-size: 0.9rem !important;
    }

    /* Ensure inputs fit screen */
    input {
        padding: 10px !important;
        font-size: 1rem !important;
    }

    /* Quizzes Specific Adjustments */
    .quiz-container {
        padding: 1rem !important;
        margin: 1rem auto !important;
        width: 95% !important;
    }
    .question h3 {
        font-size: 1.1rem !important;
    }
    .options-list label {
        font-size: 0.9rem !important;
        padding: 8px 12px !important;
    }
}

/* Animations */
@keyframes popAnim {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pop-anim {
    animation: popAnim 0.3s ease-out;
}

/* Global Custom Spinner UI */
.btn-loading {
    color: transparent !important;
    position: relative;
    pointer-events: none;
}
.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Therapeutic Page Transitions */
.page-transition {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.page-transition-enter {
    opacity: 1;
    transform: translateY(0);
}
.page-transition-exit {
    opacity: 0;
    transform: translateY(-15px);
}

/* Retrofuturistic ANON STUDIOS Terminal Elements */
/* Scanlines Overlay */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.1) 50%,
        rgba(0,0,0,0.1)
    );
    background-size: 100% 4px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.3;
}

/* CRT Screen Flicker */
@keyframes crtFlicker {
    0% { opacity: 0.95; }
    5% { opacity: 0.85; }
    10% { opacity: 0.95; }
    15% { opacity: 1; }
    50% { opacity: 0.98; }
    100% { opacity: 0.92; }
}



/* Terminal Banner */
.retro-banner {
    position: relative;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: var(--primary-accent);
    padding: 5px 0;
    font-size: 0.8rem;
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
    overflow: hidden;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    z-index: 1000;
}

.retro-banner span {
    display: inline-block;
    padding-left: 100%;
    animation: scrollBanner 20s linear infinite;
}

@keyframes scrollBanner {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

/* Header Terminal Glow */
.header h1 {
    text-shadow: 0 0 5px var(--primary-accent), 0 0 10px var(--primary-accent), 0 0 20px var(--primary-accent-hover);
}
