/* WagWager Design System */
:root {
    --bg-color: #0c0f1d;
    --surface: #1a1e36;
    --surface-glass: rgba(26, 30, 54, 0.7);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand {
    font-family: var(--font-display);
}

/* Core Layout */
#app {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.view {
    display: none;
    flex: 1;
    animation: fadeIn 0.4s ease-out forwards;
}

.view.active-view {
    display: flex;
    flex-direction: column;
}

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

/* Typography & Utilities */
.hidden { display: none !important; }
.mt-4 { margin-top: 2rem; }
.error-text { color: var(--error); font-size: 0.875rem; font-weight: 500; margin-top: 0.5rem; text-align: center; }

/* Components */
.card {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-panel {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.btn {
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: white;
    box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover, .btn-primary:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 var(--primary-glow);
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* specific status badges will be colored via JS classes */
.badge.open { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.badge.locked { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.badge.finished { background: rgba(99, 102, 241, 0.2); color: var(--text-muted); }

/* Login View */
.login-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

.brand {
    text-align: center;
    margin-bottom: 2.5rem;
}

.brand h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.brand p {
    color: var(--secondary);
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Dashboard Nav */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.balance-pill {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 700;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Dashboard Content */
.dashboard-container {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.races-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.race-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Odds List */
.odds-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.odd-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: background 0.2s;
}

.odd-row:active {
    background: rgba(255, 255, 255, 0.08);
}

.odd-dog-name {
    font-weight: 600;
}

.odd-value {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--secondary);
    font-size: 1.1rem;
}

/* Loader */
.loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--surface);
    border-bottom-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-view {
    justify-content: center;
    align-items: center;
}
