/**
 * TORN SCONES - MASTER STYLESHEET
 * Theme-aware accessibility, Torn-integrated color palettes.
 */

/* --- 1. Theme Variables --- */
:root, [data-theme="dark"] {
    --bg: #0d1117; --card: #161b22; --border: #30363d; 
    --blue: #58a6ff; --green: #3fb950; --yellow: #d29922; 
    --red: #f85149; --gold: #f39c12; --text: #c9d1d9; --font-size: 100%;
    --badge-gold-bg: #f39c12;
    --badge-gold-text: #1a1a1a;
}
[data-theme="light"] {
    --bg: #ffffff; --card: #f6f8fa; --border: #d0d7de; 
    --blue: #0969da; --green: #1a7f37; --yellow: #9a6700; 
    --red: #cf222e; --gold: #bf8700; --text: #24292f;
    --badge-gold-bg: #9a6700;
    --badge-gold-text: #ffffff;
}
[data-theme="hicontrast"] {
    --bg: #000000; --card: #000000; --border: #ffffff; --text: #ffffff;
    --blue: #00ffff; --green: #00ff00; --red: #ff0000; --yellow: #ffff00; --gold: #ffff00;
    --badge-gold-bg: #ffff00;
    --badge-gold-text: #000000;
}

/* --- 2. Global Reset & Layout --- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: var(--font-size); scroll-behavior: smooth; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background: var(--bg); color: var(--text); padding: 0; margin: 0; 
    overflow-x: hidden; width: 100vw; transition: background 0.3s, color 0.3s;
}
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 15px 40px 15px; }

/* --- 3. Header & Navigation --- */
.scones-header { 
    background: var(--card); border-bottom: 1px solid var(--border); 
    height: 60px; display: flex; align-items: center; justify-content: space-between; 
    padding: 0 15px; position: sticky; top: 0; z-index: 1000; 
}

.persona-bar {
    background: #000; border-bottom: 2px solid var(--red);
    padding: 5px 15px; font-size: 0.75rem; display: flex; align-items: center; justify-content: center; gap: 15px;
}

.brand { display: flex; align-items: center; gap: 5px; text-decoration: none; color: #fff; font-weight: 800; font-size: 1.2rem; }
.brand .accent { color: var(--gold); }

.nav-links { display: none; gap: 20px; }
.nav-links a { text-decoration: none; color: var(--text); font-size: 0.85rem; font-weight: 500; }
.nav-links a:hover { color: var(--gold); }

/* Accessibility Drawer */
.a11y-drawer {
    display: none; background: var(--card); border-bottom: 2px solid var(--gold);
    padding: 15px; font-size: 0.85rem; position: sticky; top: 60px; 
    z-index: 998; animation: slideDown 0.2s ease-out; box-shadow: 0 10px 15px rgba(0,0,0,0.2);
}
.a11y-drawer.open { display: block; }

/* --- 4. Dashboard (Replaced Hub) --- */
.dashboard-hero { text-align: center; padding: 40px 20px; background: linear-gradient(180deg, rgba(243, 156, 18, 0.1) 0%, rgba(13, 17, 23, 0) 100%); border-radius: 12px; margin: 20px 0; }
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px) { .dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } }

.card { 
    background: var(--card); border: 1px solid var(--border); border-radius: 10px; 
    padding: 25px; text-decoration: none; color: var(--text); transition: 0.2s; 
    display: flex; flex-direction: column; gap: 12px; position: relative;
    overflow: hidden;
}
.card::before { content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--border); }
.card:hover { transform: translateY(-3px); border-color: var(--gold); }
.card.access-faction::before { background: var(--green); }
.card.access-overlord::before { background: var(--gold); }
.card.access-developer::before { background: var(--red); }

/* Skip Link */
.skip-link {
    position: absolute; top: -100px; left: 0; background: var(--gold); 
    color: #000; padding: 10px 20px; z-index: 9999; font-weight: bold;
}
.skip-link:focus { top: 0; }

@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 768px) { 
    .nav-links { display: flex !important; } 
}

.welcome-card {
    display: flex;
    flex-direction: column; /* Default: Stacked (Mobile first) */
    align-items: center;    /* Center items when stacked */
    gap: 20px;
    text-align: center;     /* Center text on mobile */
}

.welcome-content {
    flex: 1; /* Takes up remaining space on desktop */
}

.welcome-image img {
    max-width: 150px; /* Adjust size as needed */
    height: auto;
    display: block;
}

/* Tablet and Desktop View */
@media (min-width: 600px) {
    .welcome-card {
        flex-direction: row; /* Side-by-side */
        text-align: left;    /* Revert text to left-aligned */
        justify-content: space-between;
    }

    .welcome-image {
        order: 2; /* Ensures image stays on the right */
    }
}
.mascot-glow {
    /* offset-x | offset-y | blur-radius | color */
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6)) 
            drop-shadow(0 0 2px rgba(255, 255, 255, 0.8));
    
    /* Optional: Ensure the image renders crisply */
    image-rendering: auto;
}
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 4px;
    gap: 8px; /* Space between icon and text */
}

.nav-link:hover {
    background: rgba(255, 215, 0, 0.1); /* Subtle gold tint */
    color: var(--gold);
}

.nav-link .material-icons {
    font-size: 20px;
}

/* Optional: Active state highlighting */
.nav-link.active {
    border-bottom: 2px solid var(--gold);
    color: var(--gold);
}
.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;  /* Preferred icon size */
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;

    /* Support for all WebKit browsers (Chrome Mobile) */
    -webkit-font-smoothing: antialiased;
    /* Support for Safari and Chrome */
    text-rendering: optimizeLegibility;
}
.card h2 {
    display: flex;
    align-items: center; /* This is the magic line for vertical centering */
    gap: 12px;           /* Adjust this for the space between icon and text */
    margin-top: 0;       /* Standardize margins for better card flow */
}

/* Optional: If the icon still feels 1px off due to the specific font-face */
.card h2 .material-icons {
    display: inline-flex;
    vertical-align: middle;
    /* transform: translateY(1px); */ /* Use this only as a last resort tweak */
}
.card span {
    color: var(--gold);
}
/* Base style for all symbols */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    transition: font-variation-settings 0.3s ease, color 0.3s ease, text-shadow 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Hover effect: Fill the icon and add a subtle glow */
.nav-link:hover .material-symbols-outlined,
.card:hover .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    color: var(--gold);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}
.persona_bar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.flex-label {
    display: inline-flex;  /* Keeps the label from taking up the whole line */
    align-items: center;   /* Perfectly centers the checkbox, text, and bug icon */
    gap: 8px;              /* Adds consistent spacing between the parts */
    cursor: pointer;       /* Makes the whole area feel clickable */
    font-size: 0.9rem;
}

.flex-label .material-symbols-outlined {
    font-size: 1.2rem;     /* Sizes the bug icon to match the text height */
    color: var(--gold);
}
