/* ==========================================================================
   Marcturus — Design System
   A modernized, award-winning take on the Habbo-themed Symfony CMS.
   ========================================================================== */

:root {
    /* Surface palette — deep cosmic blues */
    --bg-deep:        #050b1d;
    --bg-base:        #07112a;
    --bg-elev-1:      #0d1a3a;
    --bg-elev-2:      #142755;
    --bg-glass:       rgba(255, 255, 255, 0.06);
    --bg-glass-strong: rgba(255, 255, 255, 0.10);

    /* Accent palette */
    --accent-gold:    #ffd34d;
    --accent-gold-2:  #f5a13a;
    --accent-green:   #2bd47e;
    --accent-green-2: #15a35b;
    --accent-blue:    #5ac8ff;
    --accent-pink:    #ff6cb6;
    --accent-violet:  #8b6cff;

    /* Text */
    --text:           #f4f7ff;
    --text-soft:      #c8d2ec;
    --text-muted:     #8390b6;
    --text-dim:       #5b6892;

    /* Lines & shadows */
    --line:           rgba(255, 255, 255, 0.08);
    --line-strong:    rgba(255, 255, 255, 0.16);
    --shadow-sm:      0 2px 6px rgba(0, 0, 0, 0.20);
    --shadow-md:      0 10px 30px -10px rgba(0, 0, 0, 0.55);
    --shadow-lg:      0 30px 60px -20px rgba(0, 0, 0, 0.65);
    --shadow-glow:    0 0 0 1px rgba(255, 211, 77, 0.40), 0 8px 24px -6px rgba(255, 211, 77, 0.35);

    --radius-sm:      6px;
    --radius:         12px;
    --radius-lg:      18px;
    --radius-xl:      24px;

    --ease:           cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    color: var(--text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background: radial-gradient(1200px 600px at 80% -10%, #1d3a78 0%, transparent 60%),
                radial-gradient(900px 600px at -10% 110%, #1b2c63 0%, transparent 55%),
                linear-gradient(180deg, var(--bg-deep), var(--bg-base) 60%, #02060f 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
    border-radius: 4px;
}

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

h1, h2, h3, h4 { font-family: "Space Grotesk", "Inter", sans-serif; letter-spacing: -0.01em; }

::selection { background: var(--accent-gold); color: #1a1304; }

/* --------------------------------------------------------------------------
   Page chrome
   -------------------------------------------------------------------------- */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    width: 100%;
}

.main-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    background: linear-gradient(180deg, rgba(10, 24, 56, 0.85), rgba(10, 24, 56, 0.55));
    border-bottom: 1px solid var(--line);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    letter-spacing: 0.18em;
    font-size: 0.85rem;
    color: var(--text);
}

.logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 800;
    color: #1a1304;
    background: linear-gradient(140deg, #ffe06a 0%, #f59f3a 60%, #d57218 100%);
    box-shadow: 0 6px 18px -8px rgba(245, 161, 58, 0.85),
                inset 0 -3px 0 rgba(0, 0, 0, 0.18);
    font-size: 1.1rem;
}

.primary-nav {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.primary-nav a {
    padding: 0.5rem 0.95rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
    transition: background-color 200ms var(--ease), color 200ms var(--ease);
}

.primary-nav a:hover, .primary-nav a:focus {
    background: var(--bg-glass);
    color: var(--text);
}

.user-area {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.user-greeting {
    font-size: 0.85rem;
    color: var(--text-soft);
    font-weight: 500;
}

.play-button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.3rem;
    border-radius: 999px;
    border: 0;
    cursor: pointer;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: #04240e;
    background: linear-gradient(140deg, #58e87f 0%, #16a35a 100%);
    box-shadow: 0 6px 18px -6px rgba(43, 212, 126, 0.55),
                inset 0 -2px 0 rgba(0, 0, 0, 0.20);
    transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
}

.play-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px -8px rgba(43, 212, 126, 0.65),
                inset 0 -2px 0 rgba(0, 0, 0, 0.20);
}

.play-glyph { font-size: 0.75em; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    margin-top: 4rem;
    padding: 2.5rem 1.25rem 3rem;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.45));
    border-top: 1px solid var(--line);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.footer-inner { max-width: 1280px; margin: 0 auto; }

.footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-top span {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    color: var(--text);
    font-weight: 700;
}

.social-icons { display: flex; gap: 0.4rem; }

.social-icons a {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--line);
    transition: background 200ms var(--ease);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 700;
}

.social-icons a:hover { background: var(--bg-glass-strong); }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.4rem;
    margin-bottom: 1.2rem;
}

.footer-links a { color: var(--text-muted); transition: color 200ms; }
.footer-links a:hover { color: var(--text); }

.footer-bottom {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-bottom p { margin: 0; max-width: 740px; line-height: 1.55; }

.footer-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, #4cb8ff, #082549 70%);
    border: 1px solid var(--line-strong);
    color: #e9f4ff;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 800;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font: 600 0.86rem/1 "Inter", sans-serif;
    cursor: pointer;
    transition: transform 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease), color 180ms;
    text-decoration: none;
    background: var(--bg-glass);
    color: var(--text);
    border-color: var(--line);
}

.btn:hover { transform: translateY(-1px); background: var(--bg-glass-strong); }
.btn:active { transform: translateY(0); }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.78rem; border-radius: 8px; }

.btn-primary {
    background: linear-gradient(140deg, #6c8aff 0%, #4361d2 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 20px -10px rgba(108, 138, 255, 0.7);
}
.btn-primary:hover { background: linear-gradient(140deg, #7d99ff 0%, #5874e4 100%); }

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text);
}

.btn-success {
    background: linear-gradient(140deg, #58e87f 0%, #16a35a 100%);
    color: #04240e;
    border-color: transparent;
}

.btn-warning {
    background: linear-gradient(140deg, #ffd56b 0%, #f0a73c 100%);
    color: #2a1700;
    border-color: transparent;
}

.btn-danger {
    background: linear-gradient(140deg, #ff7378 0%, #d83a3f 100%);
    color: #fff;
    border-color: transparent;
}

.btn-block { width: 100%; }

/* --------------------------------------------------------------------------
   Status badges
   -------------------------------------------------------------------------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
    backdrop-filter: blur(2px);
}

/* --------------------------------------------------------------------------
   Cards & containers
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px) saturate(120%);
    overflow: hidden;
}

.card__head {
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.card__head h3 { margin: 0; font-size: 1.05rem; }

.card__body { padding: 1.4rem; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group + .form-group { margin-top: 1rem; }

.form-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: rgba(2, 8, 20, 0.6);
    color: var(--text);
    font: 500 0.92rem/1.4 "Inter", sans-serif;
    transition: border-color 200ms var(--ease), box-shadow 200ms, background 200ms;
}

.form-input::placeholder, .form-textarea::placeholder { color: rgba(255, 255, 255, 0.32); }

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(255, 211, 77, 0.18);
    background: rgba(2, 8, 20, 0.85);
    outline: none;
}

.form-textarea { min-height: 140px; resize: vertical; }

.alert {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    margin-bottom: 1rem;
}
.alert-danger {
    background: rgba(216, 58, 63, 0.12);
    border: 1px solid rgba(216, 58, 63, 0.45);
    color: #ffb1b3;
}
.alert-success {
    background: rgba(43, 212, 126, 0.12);
    border: 1px solid rgba(43, 212, 126, 0.45);
    color: #b9f3d3;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

table.data thead th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--line);
}

table.data tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--line);
    color: var(--text-soft);
    vertical-align: middle;
}

table.data tbody tr { transition: background 180ms var(--ease); }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.04); }

table.data .id { color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Aurora background blobs (auth pages)
   -------------------------------------------------------------------------- */
.aurora {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.aurora-blob {
    position: absolute;
    width: 60vmax;
    height: 60vmax;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.5;
    mix-blend-mode: screen;
}

.aurora-blob--a {
    top: -20vmax; left: -10vmax;
    background: radial-gradient(circle, #5ac8ff 0%, transparent 60%);
}
.aurora-blob--b {
    bottom: -25vmax; right: -10vmax;
    background: radial-gradient(circle, #ff6cb6 0%, transparent 60%);
    opacity: 0.4;
}
.aurora-blob--c {
    top: 30vmax; left: 30vmax;
    background: radial-gradient(circle, #ffd34d 0%, transparent 60%);
    opacity: 0.30;
}

.page-wrapper { position: relative; z-index: 1; }

/* --------------------------------------------------------------------------
   NavLink active state
   -------------------------------------------------------------------------- */
.primary-nav a.is-active {
    background: linear-gradient(140deg, rgba(255, 211, 77, 0.20), rgba(245, 161, 58, 0.10));
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(255, 211, 77, 0.30);
}

/* --------------------------------------------------------------------------
   Validation messages (Blazor's <ValidationMessage>)
   -------------------------------------------------------------------------- */
.validation-message {
    color: #ff8e92;
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 0.2rem;
}

.validation-errors { color: #ff8e92; font-size: 0.85rem; margin-bottom: 0.6rem; }

/* Blazor's auto-flagged states */
.invalid {
    border-color: rgba(216, 58, 63, 0.65) !important;
    box-shadow: 0 0 0 3px rgba(216, 58, 63, 0.18) !important;
}
.modified.valid {
    border-color: rgba(43, 212, 126, 0.45);
}

/* --------------------------------------------------------------------------
   Page loader (used by <PageLoader>)
   -------------------------------------------------------------------------- */
.page-loader {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    padding: 1.4rem;
}

.page-loader__orbit {
    position: relative;
    width: 28px;
    height: 28px;
}
.page-loader__orbit span {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--accent-gold);
    animation: orbit 1s linear infinite;
}
.page-loader__orbit span:nth-child(2) {
    border-top-color: var(--accent-blue);
    inset: 4px;
    animation-duration: 1.4s;
    animation-direction: reverse;
}
.page-loader__orbit span:nth-child(3) {
    border-top-color: var(--accent-pink);
    inset: 8px;
    animation-duration: 1.8s;
}

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

/* --------------------------------------------------------------------------
   Blazor reconnection banner
   -------------------------------------------------------------------------- */
#blazor-error-ui,
.blazor-error-boundary {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: rgba(216, 58, 63, 0.95);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.5);
    font-size: 0.88rem;
    display: none;
}

#blazor-error-ui[style*="block"] { display: flex !important; gap: 0.6rem; align-items: center; }

#blazor-error-ui .reload {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    cursor: pointer;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    opacity: 0.7;
    margin-left: 0.4rem;
}

#components-reconnect-modal {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 16, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    color: white;
    backdrop-filter: blur(6px);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
    .top-bar { flex-wrap: wrap; }
    .primary-nav { order: 3; width: 100%; justify-content: flex-start; flex-wrap: wrap; }
    .footer-top { flex-direction: column; align-items: flex-start; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .container { padding: 1.25rem 1rem 3rem; }
}
