/* style.css - Clean & Accessible Version */

:root {
    /* DEFAULT THEME (Dark Mode - The Kolvas "Vibe") */
    --bg-body: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-container: rgba(15, 15, 35, 0.95);
    --bg-panel: #1a1a2e;
    --text-main: #e0e0e0;
    --text-muted: #a0aec0;
    --accent-pink: #ff6b9d;
    --accent-green: #63d471;
    --accent-green-hover: #7fffa3;
    --border-color: #4a5568;
    --card-bg: #2d3748;
    --table-header-bg: rgba(255, 107, 157, 0.15);
    --table-row-hover: rgba(99, 212, 113, 0.05);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* --- ACCESSIBILITY OVERRIDE --- */

/* Simple Design Mode (High Contrast Light Mode) */
body.simple-design {
    --bg-body: #ffffff;
    --bg-container: #ffffff;
    --bg-panel: #ffffff;
    --text-main: #000000;      /* Pure black text */
    --text-muted: #222222;     /* Dark grey for secondary text */
    --accent-pink: #000000;    /* HEADERS ARE NOW BLACK */
    --accent-green: #0000EE;   /* Links are Standard Blue */
    --accent-green-hover: #551A8B; /* Visited/Hover purple */
    --border-color: #000000;   /* Solid black borders */
    --card-bg: #ffffff;
    --table-header-bg: #dddddd; /* Light grey table headers (No pink) */
    --table-row-hover: #f2f2f2;
    --shadow: none;
}

/* --- RESET & BASICS --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background: var(--bg-body);
    min-height: 100vh;
    padding: 20px;
}

/* Font Sizing Controls */
body.font-small { font-size: 14px; }
body.font-medium { font-size: 16px; }
body.font-large { font-size: 19px; }
body.font-xlarge { font-size: 22px; }

/* --- LAYOUT --- */
.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-container);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

/* --- TYPOGRAPHY --- */
h1 {
    color: var(--accent-pink);
    font-size: 2.5em;
    margin-bottom: 20px;
    text-align: center;
}

h2 {
    color: var(--accent-pink);
    font-size: 1.8em;
    margin: 40px 0 20px 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 5px;
}

h3 { color: var(--accent-pink); margin-top: 25px; margin-bottom: 10px; }

a { color: var(--accent-green); transition: color 0.2s; text-decoration: none; }
a:hover { color: var(--accent-green-hover); text-decoration: underline; }

/* --- COMPONENTS --- */

/* Intro Box */
.intro {
    background: rgba(255, 107, 157, 0.1);
    padding: 20px;
    border-left: 4px solid var(--accent-pink);
    margin-bottom: 30px;
    border-radius: 4px;
}
/* Simple design override for Intro is handled by variables, 
   but we ensure the border is solid */
body.simple-design .intro { border: 1px solid #000; border-left-width: 4px; }

/* Warning & Tip Boxes */
.warning-box {
    background: rgba(255, 0, 0, 0.1);
    border-left: 4px solid #ff4444;
    padding: 15px;
    margin: 20px 0;
}
.tip-box {
    background: rgba(99, 212, 113, 0.1);
    border-left: 4px solid var(--accent-green);
    padding: 15px;
    margin: 20px 0;
}
/* Simple design overrides for alerts */
body.simple-design .warning-box { background: #fff0f0; border: 1px solid #d00; border-left-width: 4px; color: #000; }
body.simple-design .tip-box { background: #f0fff0; border: 1px solid #006400; border-left-width: 4px; color: #000; }

/* Navigation Cards (Home Page) */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}
.nav-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    display: block;
    transition: transform 0.2s;
    text-decoration: none; /* fix for simple design links */
}
.nav-card:hover { transform: translateY(-3px); border-color: var(--accent-pink); }
.nav-card h3 { margin-top: 0; }
.nav-card p { color: var(--text-muted); }

/* Table of Contents */
.toc {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid var(--accent-green);
}
.toc ul { list-style: none; margin-left: 10px; }
.toc li { margin: 5px 0; }

/* Tables */
.table-wrapper { overflow-x: auto; margin: 20px 0; }
.resource-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}
.resource-table th {
    background: var(--table-header-bg);
    color: var(--accent-pink);
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}
.resource-table td {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    vertical-align: top;
}
.resource-table tr:hover { background: var(--table-row-hover); }

/* --- FLOATING ELEMENTS --- */
/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-pink);
    color: #000;
    padding: 8px;
    z-index: 2000;
    font-weight: bold;
    text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Neocities Badge */
.neocities-badge { position: fixed; bottom: 20px; right: 20px; z-index: 900; opacity: 0.8; }
.neocities-badge:hover { opacity: 1; }
.neocities-badge img { display: block; height: 31px; width: 88px; }

/* Accessibility Panel */
.a11y-toggle {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 1001;
    background: var(--accent-pink);
    color: #000;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
.a11y-panel {
    position: fixed;
    top: 65px; right: 20px;
    z-index: 1000;
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    width: 240px;
    display: none;
}
.a11y-panel h4 { margin-top: 0; font-size: 1em; }
.a11y-panel button {
    display: block; width: 100%;
    margin-bottom: 8px; padding: 8px;
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    cursor: pointer;
}
.a11y-panel button:hover { opacity: 0.8; }
.a11y-panel button.active { border-left: 4px solid var(--accent-green); font-weight: bold;}
.font-size-controls { display: flex; gap: 5px; }

/* Footer */
footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9em;
}
.disclaimer {
    background: rgba(20, 20, 20, 0.6);
    padding: 15px;
    border: 1px solid var(--border-color);
    font-size: 0.85em;
    margin-top: 40px;
    border-radius: 8px;
}
body.simple-design .disclaimer { background: #eee; color: #000; }

/* Mobile */
@media (max-width: 600px) {
    .container { padding: 20px; border: none; }
    .neocities-badge { display: none; }
    .resource-table { font-size: 0.9em; }
}

/* --- Quick Exit / Escape Button --- */
.escape-btn {
    position: fixed;
    bottom: 20px; /* Or 'top: 20px' if you prefer */
    left: 20px;
    z-index: 10000; /* Must be on top of everything */
    background-color: #d32f2f; /* Urgent Red */
    color: #ffffff !important; /* Force white text */
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: background 0.2s, transform 0.1s;
    font-family: sans-serif;
    cursor: pointer;
}

.escape-btn:hover {
    background-color: #b71c1c; /* Darker red on hover */
    text-decoration: none;
}

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

/* Make sure it stands out in Simple Design mode too */
body.simple-design .escape-btn {
    border: 2px solid #000;
    box-shadow: none;
}

/* Mobile adjustment */
@media (max-width: 600px) {
    .escape-btn {
        bottom: 10px;
        left: 10px;
        padding: 10px 15px;
        font-size: 0.9em;
    }
}