/* ============================================================
   D4 Builds — Main Stylesheet (Diablo 4 Dark Theme)
   ============================================================ */

/* --- CSS Custom Properties (Theme) --- */
:root {
    /* Backgrounds */
    --bg-primary: #0a0a0f;
    --bg-secondary: #0e0f14;
    --bg-panel: #13151a;
    --bg-panel-hover: #1a1c23;
    --bg-input: #0e1015;
    --bg-overlay: rgba(0, 0, 0, 0.85);

    /* Accent colors */
    --gold: #c4a24e;
    --gold-bright: #dab85c;
    --gold-dark: #8a7235;
    --gold-dim: #6b5a2e;
    --legendary-purple: #8b5cf6;
    --unique-gold: #a37e2c;
    --mythic-red: #ff6b6b;
    --rare-yellow: #ffd700;
    --magic-blue: #4a90d9;
    --set-green: #00ff7f;

    /* Text */
    --text-primary: #e0ddd5;
    --text-secondary: #a09d94;
    --text-dimmed: #7a7870;
    --text-dark: #4a4840;

    /* Borders */
    --border-color: #2a2a35;
    --border-panel: #252830;
    --border-gold: #c4a24e33;
    --border-hover: #3a3a45;

    /* Functional */
    --success: #4ade80;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Fonts */
    --font-heading: 'Cinzel', 'Times New Roman', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

    /* Sizes */
    --header-height: 64px;
    --max-width: 1440px;
    --border-radius: 4px;
    --border-radius-lg: 8px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Subtle noise texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(196, 162, 78, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--gold-bright);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* --- Header / Navigation --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.98) 0%, rgba(10, 10, 15, 0.95) 100%);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
}

.header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header__logo:hover {
    color: var(--gold-bright);
}

.header__logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--bg-primary);
    font-weight: 900;
}

.header__nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.header__nav a {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.header__nav a:hover,
.header__nav a.active {
    color: var(--gold);
    background: rgba(196, 162, 78, 0.08);
}

.header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1;
}

.btn--primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--bg-primary);
    border-color: var(--gold);
}

.btn--primary:hover {
    background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 100%);
    color: var(--bg-primary);
    box-shadow: 0 0 20px rgba(196, 162, 78, 0.3);
}

.btn--secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn--secondary:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-panel);
}

.btn--ghost {
    background: transparent;
    color: var(--gold);
    border-color: transparent;
}

.btn--ghost:hover {
    background: rgba(196, 162, 78, 0.1);
}

.btn--sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn--lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

/* --- Main Content --- */
.main-content {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: calc(100vh - var(--header-height) - 80px);
}

/* --- Cards / Panels --- */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-panel);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
}

.panel--hover:hover {
    border-color: var(--border-hover);
    background: var(--bg-panel-hover);
}

/* --- Class Selection Grid (Landing Page) --- */
.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero__title {
    font-size: 3rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 40px rgba(196, 162, 78, 0.3);
}

.hero__subtitle {
    font-size: 1.1rem;
    color: var(--text-dimmed);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    max-width: 1000px;
    margin: 0 auto;
}

.class-card {
    position: relative;
    background: var(--bg-panel);
    border: 1px solid var(--border-panel);
    border-radius: var(--border-radius-lg);
    padding: 2rem 1rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    overflow: hidden;
    text-decoration: none;
}

.class-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 30%, rgba(196, 162, 78, 0.06) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.class-card:hover {
    border-color: var(--gold-dark);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(196, 162, 78, 0.1);
}

.class-card:hover::before {
    opacity: 1;
}

.class-card__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--gold);
    transition: all var(--transition-normal);
}

.class-card:hover .class-card__icon {
    border-color: var(--gold-dark);
    box-shadow: 0 0 20px rgba(196, 162, 78, 0.2);
}

.class-card__name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: 0.03em;
}

.class-card__resource {
    font-size: 0.8rem;
    color: var(--text-dimmed);
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.form-input {
    width: 100%;
    padding: 0.65rem 0.875rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--gold-dark);
    box-shadow: 0 0 0 2px rgba(196, 162, 78, 0.15);
}

.form-input::placeholder {
    color: var(--text-dark);
}

.form-error {
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 0.25rem;
}

/* --- Auth Pages --- */
.auth-container {
    max-width: 400px;
    margin: 4rem auto;
}

.auth-container h2 {
    text-align: center;
    color: var(--gold);
    margin-bottom: 2rem;
}

.auth-container .panel {
    padding: 2rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-dimmed);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

.alert--error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.alert--success {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--success);
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-dark);
    font-size: 0.8rem;
}

.site-footer a {
    color: var(--text-dimmed);
}

.site-footer a:hover {
    color: var(--gold);
}

/* --- Utility Classes --- */
.text-gold { color: var(--gold); }
.text-dimmed { color: var(--text-dimmed); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero__title {
        font-size: 2rem;
    }

    .class-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.75rem;
    }

    .class-card {
        padding: 1.25rem 0.75rem 1rem;
    }

    .class-card__icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .header__nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .class-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero__title {
        font-size: 1.6rem;
    }
}

/* --- 404 Page --- */
.page-404 {
    text-align: center;
    padding: 6rem 2rem;
}

.page-404 h1 {
    font-size: 6rem;
    color: var(--gold-dark);
    line-height: 1;
}

.page-404 p {
    color: var(--text-dimmed);
    margin: 1rem 0 2rem;
}
