/* ═══════════════════════════════════════════════════════════════
   theme.css — House Regard / T&L Dashboard
   Shared design tokens + global components for all pages.
   Page-specific styles remain in their own CSS files.
═══════════════════════════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────────────────────────── */
:root {
    /* Gold palette */
    --gold:          #c9973a;
    --gold-light:    #e8b84b;
    --gold-dim:      #8a6520;
    --gold-border:   rgba(201, 151, 58, 0.30);
    --gold-glow:     rgba(201, 151, 58, 0.04);

    /* Crystal / blue accent */
    --crystal:        #7ecfef;
    --crystal-dim:    rgba(126, 207, 239, 0.08);
    --crystal-border: rgba(126, 207, 239, 0.2);

    /* Backgrounds */
    --bg-main:     #07060a;
    --bg-card:     #0f0d13;
    --bg-card-2:   #13111a;
    --bg-input:    #1a1724;
    --bg-header:   #0b0910;
    --bg-surface:  #0f0d13;
    --bg-elevated: #13111a;

    /* Text */
    --text-main:    #e8e2d4;
    --text-muted:   #9c9384;
    --text-faint:   #5c5548;
    --text-dim:     #5c5548;
    --text-primary: #e8e2d4;
    --text-gold:    var(--gold-light);

    /* Semantic */
    --success:       #4caf7d;
    --danger:        #c0504d;
    --info:          #4da8da;
    --purple:        #a07fd4;
    --discord:       #5865F2;
    --discord-hover: #4752C4;

    /* Role colours */
    --tank-color:   #4da8da;
    --healer-color: #82c91e;
    --dps-color:    #fa5252;

    /* Borders */
    --border-color:  rgba(201, 151, 58, 0.15);
    --border-subtle: rgba(255, 255, 255, 0.05);

    /* Typography */
    --font-display: 'Cinzel', serif;
    --font-body:    'Satoshi', 'Segoe UI', system-ui, sans-serif;
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    background-image: radial-gradient(ellipse 80% 40% at 50% -10%, rgba(201, 151, 58, 0.07) 0%, transparent 70%);
    color: var(--text-main);
    min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
input, button, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* ── NAV ─────────────────────────────────────────────────────── */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-header);
    padding: 0 30px;
    height: 60px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    font-size: 0;
}

.nav-logo-img {
    height: 32px;
    width: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--gold-border);
    box-shadow: 0 0 10px rgba(201, 151, 58, 0.2);
    flex-shrink: 0;
    display: block;
}

.nav-brand span {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    white-space: nowrap;
    line-height: 1;
    background: linear-gradient(135deg, #e8c96b 0%, #c9973a 40%, #f0d882 70%, #c9973a 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 24px;
    height: 100%;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    padding: 0 5px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover  { color: var(--gold-light); }
.nav-link.active { color: var(--gold-light); border-bottom: 2px solid var(--gold); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
button, .btn {
    padding: 9px 20px;
    border-radius: 3px;
    border: none;
    font-weight: 600;
    font-size: 13px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.4px;
    text-decoration: none;
    white-space: nowrap;
}

button:disabled, .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-gold,
.btn-primary {
    background: linear-gradient(135deg, #c9973a, #a07020);
    color: #0f0d13;
    font-weight: 700;
    box-shadow: 0 2px 12px rgba(201, 151, 58, 0.25);
    border: none;
}
.btn-gold:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #e8b84b, #c9973a);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(201, 151, 58, 0.4);
}

.btn-outline {
    background: rgba(201, 151, 58, 0.06);
    color: var(--gold);
    border: 1px solid var(--gold-border);
}
.btn-outline:hover:not(:disabled) {
    background: rgba(201, 151, 58, 0.14);
    transform: translateY(-1px);
}

.btn-green {
    background: rgba(76, 175, 125, 0.1);
    color: #4caf7d;
    border: 1px solid rgba(76, 175, 125, 0.3);
}
.btn-green:hover:not(:disabled) { background: rgba(76, 175, 125, 0.2); }

.btn-blue {
    background: rgba(77, 168, 218, 0.1);
    color: #7ec8e3;
    border: 1px solid rgba(77, 168, 218, 0.3);
}
.btn-blue:hover:not(:disabled) { background: rgba(77, 168, 218, 0.2); }

.btn-red {
    background: rgba(192, 80, 77, 0.1);
    color: #e07472;
    border: 1px solid rgba(192, 80, 77, 0.3);
}
.btn-red:hover:not(:disabled) { background: rgba(192, 80, 77, 0.2); }

.btn-logout {
    padding: 7px 16px;
    background: rgba(192, 80, 77, 0.1);
    color: #e07472;
    border: 1px solid rgba(192, 80, 77, 0.3);
    border-radius: 3px;
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-logout:hover {
    background: rgba(192, 80, 77, 0.2);
    transform: translateY(-1px);
}

.btn-discord {
    background: #5865F2;
    color: #fff;
    padding: 12px 28px;
    border-radius: 3px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}
.btn-discord:hover {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(88, 101, 242, 0.4);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

/* ── INPUTS ──────────────────────────────────────────────────── */
input[type="text"],
input[type="date"],
input[type="number"],
select,
.input-field {
    padding: 9px 14px;
    border-radius: 3px;
    border: 1px solid rgba(201, 151, 58, 0.2);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 13px;
    font-family: var(--font-body);
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
.input-field:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(201, 151, 58, 0.15);
}

input[type="date"] {
    color-scheme: dark;
    cursor: pointer;
}

input[type="file"] {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-input);
    border: 1px dashed rgba(201, 151, 58, 0.2);
    border-radius: 3px;
    padding: 7px 10px;
    cursor: pointer;
    font-family: var(--font-body);
}

select.weapon-select {
    min-width: 0;
    width: 90px;
    padding: 3px 6px;
    font-size: 11px;
    background: var(--bg-card);
    border-color: rgba(201, 151, 58, 0.15);
}

/* ── LAYOUT ──────────────────────────────────────────────────── */
.container {
    max-width: 1500px;
    margin: auto;
    padding: 30px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gold-border);
    position: relative;
}
.page-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, var(--gold), transparent);
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2vw, 1.9rem);
    font-weight: 700;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, #e8c96b 0%, #c9973a 40%, #f0d882 70%, #c9973a 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h3 {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold);
    margin-top: 0;
    display: flex;
    align-items: center;
}

.page-subtitle {
    color: var(--gold-dim);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-display);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-top: 3px;
}

.section-title {
    margin-bottom: 16px;
    margin-top: 10px;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold);
}

/* ── CARDS ───────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(201, 151, 58, 0.06);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 151, 58, 0.3), transparent);
}

/* ── LOGIN SCREEN ────────────────────────────────────────────── */
#loginScreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: radial-gradient(circle at center, #13111a 0%, #07060a 100%);
}

.login-box {
    background: var(--bg-card);
    padding: 50px;
    border-radius: 4px;
    border: 1px solid var(--gold-border);
    text-align: center;
    box-shadow: 0 0 60px rgba(201, 151, 58, 0.08), inset 0 1px 0 rgba(201, 151, 58, 0.06);
    position: relative;
    overflow: hidden;
}
.login-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 151, 58, 0.4), transparent);
}
.login-box h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #e8c96b 0%, #c9973a 40%, #f0d882 70%, #c9973a 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}
.login-box p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 30px;
}

/* ── TOOLBAR ─────────────────────────────────────────────────── */
.toolbar-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.toolbar-label {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold-dim);
    white-space: nowrap;
}
.toolbar-divider {
    width: 1px;
    height: 28px;
    background: var(--border-color);
    margin: 0 4px;
}

/* ── STATUS / BADGES ─────────────────────────────────────────── */
.status-text { font-size: 13px; font-weight: 500; }

.badge {
    background: rgba(201, 151, 58, 0.1);
    color: var(--gold-light);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--gold-border);
    display: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-display);
}

/* ── VIEWER BANNER ───────────────────────────────────────────── */
.viewer-banner {
    display: none;
    background: rgba(77, 168, 218, 0.06);
    border: 1px solid rgba(77, 168, 218, 0.2);
    color: #7ec8e3;
    padding: 10px 16px;
    border-radius: 3px;
    margin-bottom: 20px;
    font-size: 13px;
}

/* ── TABLES ──────────────────────────────────────────────────── */
.table-container {
    max-height: 750px;
    overflow-y: auto;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}
.table-container::-webkit-scrollbar { width: 6px; }
.table-container::-webkit-scrollbar-track { background: var(--bg-card); }
.table-container::-webkit-scrollbar-thumb {
    background: rgba(201, 151, 58, 0.3);
    border-radius: 3px;
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.mini-table th {
    padding: 6px 4px;
    font-size: 10px;
    color: var(--gold-dim);
    border-bottom: 1px solid var(--gold-border);
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.mini-table td {
    padding: 6px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.mini-table tr:last-child td { border-bottom: none; }

/* ── MODALS ──────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: var(--bg-header);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    max-width: 400px;
    width: 100%;
}

/* ── FORM GROUPS ─────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-display);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ── NAV ARCHIVE SELECT ──────────────────────────────────────── */
.nav-archive-select {
    padding: 6px 12px;
    border-radius: 3px;
    border: 1px solid rgba(201, 151, 58, 0.25);
    background: #0b0910;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    min-width: 200px;
    transition: border-color 0.2s;
    color-scheme: dark;
    -webkit-appearance: none;
    appearance: none;
}
.nav-archive-select:focus {
    outline: none;
    border-color: var(--gold);
}

/* ── SCROLLBAR (global) ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-card); }
::-webkit-scrollbar-thumb {
    background: rgba(201, 151, 58, 0.3);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(201, 151, 58, 0.6); }
