/* ═══════════════════════════════════════════════════════════
   ARCANIJAH — Global Arcane Theme
   ═══════════════════════════════════════════════════════════ */

:root {
    /* Backgrounds */
    --bg-deep:        #04040e;
    --bg-primary:     #08081a;
    --bg-secondary:   #0e0e22;
    --bg-card:        #10102a;
    --bg-card-hover:  #161638;

    /* Purples */
    --purple-deep:    #1e0a45;
    --purple-mid:     #5b21b6;
    --purple-light:   #8b5cf6;
    --purple-bright:  #a78bfa;
    --purple-glow:    #c4b5fd;

    /* Cyan / Hextech */
    --cyan:           #22d3ee;
    --cyan-dim:       #0891b2;

    /* Gold */
    --gold:           #f59e0b;
    --gold-light:     #fcd34d;

    /* Text */
    --text-primary:   #e8e8f4;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;

    /* Borders & Glows */
    --border-subtle:  rgba(139, 92, 246, 0.12);
    --border-glow:    rgba(139, 92, 246, 0.45);
    --border-cyan:    rgba(34, 211, 238, 0.35);
    --glow-purple:    rgba(139, 92, 246, 0.3);
    --glow-purple-sm: rgba(139, 92, 246, 0.15);
    --glow-cyan:      rgba(34, 211, 238, 0.2);

    /* Shape */
    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 16px;
    --radius-xl: 28px;

    /* Typography */
    --font-heading: 'Cinzel', 'Georgia', serif;
    --font-deco:    'Cinzel Decorative', 'Cinzel', serif;
    --font-body:    'Inter', 'Segoe UI', Arial, sans-serif;

    /* Z-index */
    --z-nav:   100;
    --z-modal: 200;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--purple-mid), var(--purple-deep));
    border-radius: 3px;
}

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    line-height: 1.2;
    color: var(--text-primary);
}

p { line-height: 1.75; }

a {
    color: var(--purple-bright);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--purple-glow); }

/* ── Layout helpers ─────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Sections ───────────────────────────────────────────── */
.section { padding: 6rem 0; }

.section-alt {
    background: linear-gradient(180deg,
        var(--bg-deep) 0%,
        rgba(91, 33, 182, 0.05) 40%,
        rgba(91, 33, 182, 0.05) 60%,
        var(--bg-deep) 100%);
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-shadow: 0 0 30px var(--glow-purple);
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    letter-spacing: 0.03em;
    margin-bottom: 0;
}

.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin: 1rem 0 3.5rem;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    max-width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-glow));
}
.section-divider::after {
    background: linear-gradient(90deg, var(--border-glow), transparent);
}

.divider-rune {
    color: var(--purple-bright);
    font-size: 1.1rem;
    text-shadow: 0 0 12px var(--glow-purple);
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-arcane {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--purple-mid) 0%, var(--purple-deep) 100%);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 0 20px var(--glow-purple-sm),
                inset 0 1px 0 rgba(255,255,255,0.08);
}

.btn-arcane:hover {
    background: linear-gradient(135deg, var(--purple-light) 0%, var(--purple-mid) 100%);
    box-shadow: 0 0 35px var(--glow-purple), 0 4px 20px rgba(139,92,246,0.2);
    color: #fff;
    transform: translateY(-2px);
    border-color: var(--purple-light);
}

.btn-arcane:active { transform: translateY(0); }

.btn-arcane-sm {
    padding: 0.5rem 1.2rem;
    font-size: 0.72rem;
}

.btn-arcane-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cyan);
    background: transparent;
    border: 1px solid var(--border-cyan);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 0 15px rgba(34,211,238,0.08),
                inset 0 1px 0 rgba(255,255,255,0.04);
}

.btn-arcane-outline:hover {
    background: rgba(34, 211, 238, 0.07);
    box-shadow: 0 0 30px var(--glow-cyan), 0 4px 20px rgba(34,211,238,0.1);
    color: var(--cyan);
    transform: translateY(-2px);
    border-color: var(--cyan);
}

/* ── Cards ──────────────────────────────────────────────── */
.arcane-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.35s ease;
}

.arcane-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(139,92,246,0.04) 0%, transparent 60%);
    pointer-events: none;
}

.arcane-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    box-shadow: 0 0 40px var(--glow-purple-sm), 0 20px 40px rgba(0,0,0,0.4);
    transform: translateY(-5px);
}

/* ── Tags ───────────────────────────────────────────────── */
.tag {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 20px;
    color: var(--purple-bright);
}

.tag-cyan {
    background: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.25);
    color: var(--cyan);
}

.tag-gold {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25);
    color: var(--gold-light);
}

/* ── Utility ────────────────────────────────────────────── */
.text-gradient {
    background: linear-gradient(135deg, var(--purple-bright) 0%, var(--cyan) 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glow-purple { text-shadow: 0 0 24px var(--glow-purple), 0 0 48px rgba(139,92,246,0.15); }
.glow-cyan   { text-shadow: 0 0 20px var(--glow-cyan); }

/* ── Animations ─────────────────────────────────────────── */
@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(18px, -28px) scale(1.05); }
    66%       { transform: translate(-12px, 16px) scale(0.96); }
}

@keyframes float-rune {
    0%, 100% { transform: translateY(0) rotate(-4deg); opacity: 0.1; }
    50%       { transform: translateY(-24px) rotate(4deg); opacity: 0.25; }
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.8; }
    50%       { transform: translateX(-50%) translateY(8px); opacity: 0.3; }
}

@keyframes shimmer {
    0%   { background-position: -300% center; }
    100% { background-position: 300% center; }
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Blazor error ───────────────────────────────────────── */
#blazor-error-ui {
    background: linear-gradient(135deg, #160808, #1e0a0a);
    border-top: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    bottom: 0;
    box-shadow: 0 -4px 24px rgba(239, 68, 68, 0.15);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.8rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
    font-family: var(--font-body);
    font-size: 0.9rem;
}

#blazor-error-ui a { color: #f87171; text-decoration: underline; }
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
    transition: opacity 0.2s;
}
#blazor-error-ui .dismiss:hover { opacity: 1; }

.blazor-error-boundary {
    background: rgba(180, 20, 20, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    padding: 1rem 1rem 1rem 3rem;
    color: #fca5a5;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

/* ── Form validation ────────────────────────────────────── */
.valid.modified:not([type=checkbox]) { outline: 1px solid #22c55e; }
.invalid { outline: 1px solid #ef4444; }
.validation-message { color: #f87171; font-size: 0.875rem; margin-top: 0.25rem; }

:focus-visible {
    outline: 2px solid var(--purple-light);
    outline-offset: 3px;
}

/* ── Error / NotFound pages ─────────────────────────────── */
.error-page,
.notfound-page {
    min-height: calc(100vh - 4rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    background: radial-gradient(ellipse 60% 50% at 50% 40%, rgba(91,33,182,0.1) 0%, transparent 60%),
                var(--bg-deep);
}

.error-content,
.notfound-content {
    text-align: center;
    max-width: 500px;
    animation: fade-in-up 0.6s ease;
}

.error-rune {
    font-size: 3rem;
    color: #ef4444;
    text-shadow: 0 0 20px rgba(239,68,68,0.4);
    display: block;
    margin-bottom: 1rem;
}

.notfound-rune {
    font-size: 3rem;
    color: var(--purple-bright);
    text-shadow: 0 0 20px var(--glow-purple);
    display: block;
    margin-bottom: 0.5rem;
    animation: float-rune 6s ease-in-out infinite;
}

.notfound-code {
    font-family: var(--font-heading);
    font-size: clamp(4rem, 12vw, 7rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, var(--purple-bright), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.error-title,
.notfound-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.error-subtitle,
.notfound-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.error-id-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.85rem 1.5rem;
    background: rgba(239,68,68,0.06);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    text-align: left;
}

.error-id-label {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #f87171;
    font-weight: 600;
}

.error-id-code {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: monospace;
    word-break: break-all;
}

.error-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.error-note strong { color: var(--text-secondary); }
.error-note code {
    font-size: 0.8em;
    color: var(--cyan);
    background: rgba(34,211,238,0.08);
    padding: 0.1em 0.4em;
    border-radius: 3px;
}

