/* Super League - Design System */
:root {
    --gold: #d8b25a;
    --gold-bright: #f0cf7a;
    --gold-dim: #a88a3e;
    --ink: #0d0d10;
    --paper: #f6f1e6;
    --line: rgba(216, 178, 90, .35);
    --green: #4ade80;
    --red: #f87171;
    --blue: #60a5fa;
    
    --bg-card: rgba(18, 18, 22, .92);
    --bg-input: rgba(246, 241, 230, .04);
    --border-input: rgba(246, 241, 230, .12);
    --text-dim: rgba(246, 241, 230, .6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    min-height: 100%;
    font-family: 'Inter Tight', system-ui, sans-serif;
    color: var(--paper);
    background: #000;
    -webkit-font-smoothing: antialiased;
}

/* Stage & Background */
.stage {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    isolation: isolate;
}

.stage::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0a1628 0%, #0d0d10 50%, #1a0f0f 100%);
    z-index: -3;
}

.grain {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .12;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9 0 0 0 0 0.85 0 0 0 0 0.6 0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Header */
header {
    padding: 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-family: 'Bodoni Moda', serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: .15em;
    color: var(--gold-bright);
}

nav {
    display: flex;
    gap: 8px;
}

nav a {
    padding: 10px 18px;
    color: var(--paper);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .05em;
    border-radius: 6px;
    transition: all .2s;
}

nav a:hover {
    background: rgba(246, 241, 230, .08);
}

nav a.active {
    background: var(--gold);
    color: var(--ink);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 13px;
    color: var(--text-dim);
}

.logout-btn {
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--paper);
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all .2s;
}

.logout-btn:hover {
    background: rgba(246, 241, 230, .08);
}

/* Hero */
.hero {
    text-align: center;
    padding: 60px 24px 40px;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--gold-bright);
    border: 1px solid var(--line);
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(13, 13, 16, .55);
    backdrop-filter: blur(6px);
    margin-bottom: 20px;
}

.eyebrow .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px var(--green);
}

h1 {
    font-family: 'Bodoni Moda', serif;
    font-weight: 800;
    font-size: clamp(36px, 7vw, 72px);
    line-height: 1.02;
    letter-spacing: -.01em;
    margin-bottom: 16px;
}

h1 em {
    font-style: italic;
    font-weight: 500;
    background: linear-gradient(180deg, #f5d684 0%, #b88a36 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: 16px;
    color: var(--text-dim);
    margin-bottom: 32px;
}

/* Schedule Preview */
.schedule-preview {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 8px;
    min-width: 120px;
}

.slot .day {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .2em;
    color: var(--gold-bright);
    margin-bottom: 4px;
}

.slot .time {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.slot .courts {
    font-size: 11px;
    color: var(--text-dim);
}

/* Auth Section */
.auth-section {
    padding: 40px 24px;
    display: flex;
    justify-content: center;
}

/* Cards */
.card {
    position: relative;
    background: linear-gradient(180deg, rgba(18, 18, 22, .92) 0%, rgba(10, 10, 12, .94) 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
    width: 100%;
    max-width: 420px;
}

.card::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(216, 178, 90, .12);
    border-radius: 4px;
    pointer-events: none;
}

.card-title {
    font-family: 'Bodoni Moda', serif;
    font-size: 24px;
    letter-spacing: .02em;
    margin-bottom: 8px;
}

.card-sub {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Forms */
.field {
    display: block;
    margin-bottom: 16px;
}

.field-label {
    display: block;
    font-size: 11px;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--gold-bright);
    margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 4px;
    color: var(--paper);
    font-family: inherit;
    font-size: 15px;
    transition: border-color .2s, background .2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--gold-bright);
    background: rgba(216, 178, 90, .06);
}

select option {
    background: #1a1a1e;
    color: #f6f1e6;
}

input::placeholder {
    color: rgba(246, 241, 230, .35);
}

/* Buttons */
button {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(180deg, #f0cf7a 0%, #c89a3e 100%);
    color: #1a1206;
    font-family: 'Bodoni Moda', serif;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .18em;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 8px 24px -8px rgba(216, 178, 90, .55);
    transition: transform .15s, box-shadow .2s;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px -8px rgba(216, 178, 90, .7);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

button.secondary {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--paper);
    box-shadow: none;
}

button.secondary:hover {
    background: rgba(246, 241, 230, .08);
    transform: none;
    box-shadow: none;
}

button.danger {
    background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
}

button.small {
    padding: 10px 16px;
    font-size: 12px;
    width: auto;
}

/* Success Message */
.success-msg {
    text-align: center;
    padding: 20px;
}

.success-msg svg {
    width: 48px;
    height: 48px;
    stroke: var(--green);
    fill: none;
    stroke-width: 1.5;
    margin-bottom: 12px;
}

.success-msg p {
    color: var(--paper);
    font-size: 15px;
}

/* Links */
a {
    color: var(--gold-bright);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.register-link {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-dim);
    text-align: center;
}

/* Info Section */
.info-section {
    padding: 40px 24px 60px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid rgba(246, 241, 230, .08);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
}

.info-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.info-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.info-card p {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
}

/* Footer */
footer {
    text-align: center;
    padding: 24px;
    font-size: 11px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-dim);
    border-top: 1px solid rgba(246, 241, 230, .08);
}

.sep {
    margin: 0 10px;
    color: var(--gold);
}

/* Dashboard Layouts */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-dim);
    font-size: 14px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid rgba(246, 241, 230, .08);
    border-radius: 8px;
    padding: 20px;
}

.stat-label {
    font-size: 11px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.stat-value {
    font-family: 'Bodoni Moda', serif;
    font-size: 32px;
    font-weight: 600;
    color: var(--gold-bright);
}

.stat-value.positive { color: var(--green); }
.stat-value.negative { color: var(--red); }

/* Tables */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid rgba(246, 241, 230, .08);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(246, 241, 230, .08);
}

.table-header h2 {
    font-size: 16px;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(246, 241, 230, .06);
}

th {
    font-size: 11px;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 600;
    background: rgba(0, 0, 0, .2);
}

td {
    font-size: 14px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(246, 241, 230, .02);
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    border-radius: 4px;
}

.badge.confirmed {
    background: rgba(74, 222, 128, .15);
    color: var(--green);
}

.badge.needs-sub {
    background: rgba(248, 113, 113, .15);
    color: var(--red);
}

.badge.pending {
    background: rgba(251, 191, 36, .15);
    color: #fbbf24;
}

.badge.paid {
    background: rgba(96, 165, 250, .15);
    color: var(--blue);
}

/* Session Cards (for schedule view) */
.sessions-grid {
    display: grid;
    gap: 16px;
}

.session-card {
    background: var(--bg-card);
    border: 1px solid rgba(246, 241, 230, .08);
    border-radius: 8px;
    padding: 20px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
}

.session-date {
    text-align: center;
    min-width: 60px;
}

.session-date .day {
    font-size: 24px;
    font-weight: 700;
    color: var(--gold-bright);
    line-height: 1;
}

.session-date .month {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .15em;
    color: var(--text-dim);
}

.session-date .weekday {
    font-size: 12px;
    font-weight: 600;
    color: var(--paper);
    margin-top: 4px;
}

.session-details h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.session-details .players {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.player-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(246, 241, 230, .06);
    border-radius: 20px;
    font-size: 13px;
}

.player-chip.you {
    background: rgba(216, 178, 90, .15);
    color: var(--gold-bright);
}

.player-chip.sub {
    background: rgba(96, 165, 250, .15);
    color: var(--blue);
}

.player-chip.needs-sub {
    background: rgba(248, 113, 113, .15);
    color: var(--red);
}

.session-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-family: 'Bodoni Moda', serif;
    font-size: 22px;
    margin-bottom: 8px;
}

.modal-sub {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions button {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 16px;
    }
    
    nav {
        width: 100%;
        justify-content: center;
    }
    
    .session-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .session-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .table-wrapper {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeIn .3s ease-out;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--gold-dim);
    border-top-color: var(--gold-bright);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
    z-index: 2000;
    animation: slideIn .3s ease-out;
}

.toast.success {
    border-color: var(--green);
}

.toast.error {
    border-color: var(--red);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
