:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    --accent: #58a6ff;
    --green: #3fb950;
    --green-fill: rgba(63, 185, 80, 0.15);
    --red: #f85149;
    --red-fill: rgba(248, 81, 73, 0.15);
    --yellow: #f0c000;
    --orange: #db6d28;
    --border: #30363d;
}

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

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

.ascii-logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    line-height: 1.1;
    color: var(--accent);
    margin: 0;
    display: inline-block;
}

.subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* Carousel Navigation */
.carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.nav-arrow {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-arrow:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--accent);
    color: var(--accent);
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.date-display {
    text-align: center;
    min-width: 200px;
}

.date-label {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.date-status {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.date-status.live {
    color: var(--green);
}

.date-status.live::before {
    content: '●';
    margin-right: 0.5rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Chart */
.chart-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.chart-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    height: 400px;
}

.tooltip {
    position: absolute;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 100;
    white-space: nowrap;
}

.tooltip.visible {
    opacity: 1;
}

.tooltip .price {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tooltip .time {
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    z-index: 50;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Stats */
.stats {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 600;
}

.stat-value.high { color: var(--green); }
.stat-value.low { color: var(--red); }
.stat-value.buy { color: var(--yellow); }
.stat-value.sell { color: var(--orange); }

/* Day indicators */
.day-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.day-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.day-dot:hover {
    background: var(--text-secondary);
}

.day-dot.active {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

/* Legend */
.legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.buy-dot {
    background: var(--yellow);
    box-shadow: 0 0 8px var(--yellow);
}

.sell-dot {
    background: var(--orange);
    box-shadow: 0 0 8px var(--orange);
}

/* Connection status */
.connection-status {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.connection-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.connection-status.connected .status-dot {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
}

.connection-status.waiting .status-dot {
    background: var(--yellow);
    animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .stats {
        flex-wrap: wrap;
    }
    
    .stat {
        flex: 1 1 45%;
    }
    
    .chart-container {
        height: 300px;
    }
}

/* Grid Levels Display */
.grid-levels {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.grid-levels-header {
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grid-levels-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.grid-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
}

.grid-column-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.grid-column-header.buy {
    color: var(--yellow);
    background: rgba(240, 192, 0, 0.1);
}

.grid-column-header.sell {
    color: var(--orange);
    background: rgba(219, 109, 40, 0.1);
}

.grid-level {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    min-width: 100px;
    text-align: center;
}

.grid-level.buy {
    color: var(--yellow);
    background: rgba(240, 192, 0, 0.08);
    border: 1px solid rgba(240, 192, 0, 0.2);
}

.grid-level.sell {
    color: var(--orange);
    background: rgba(219, 109, 40, 0.08);
    border: 1px solid rgba(219, 109, 40, 0.2);
}

.grid-level.filled {
    opacity: 0.5;
    text-decoration: line-through;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.auth-card .ascii-logo {
    margin-bottom: 1.5rem;
}

.auth-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.auth-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 0.5rem;
}

.auth-btn:hover:not(:disabled) {
    opacity: 0.9;
}

.auth-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-error {
    background: var(--red-fill);
    border: 1px solid var(--red);
    color: var(--red);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.auth-success {
    background: var(--green-fill);
    border: 1px solid var(--green);
    color: var(--green);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.auth-link {
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Waitlist Message */
.waitlist-message {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: left;
    line-height: 1.6;
}

.waitlist-message p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.waitlist-message .thank-you {
    color: var(--accent);
    font-weight: 600;
    text-align: center;
    margin-bottom: 0;
}

/* Logout Button */
.logout-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.logout-btn:hover {
    border-color: var(--red);
    color: var(--red);
}

header {
    position: relative;
}
