/* public/style.css */
:root {
    --bg-base: #f3f4f6;
    --bg-surface: #ffffff;
    --bg-subtle: #f9fafb;
    --text-base: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    
    --accent-blue: #2563eb;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

/* Automatic Color Swap for Dark Mode */
body.dark-mode {
    --bg-base: #111827;
    --bg-surface: #1f2937;
    --bg-subtle: #374151;
    --text-base: #f9fafb;
    --text-muted: #9ca3af;
    --border-color: #374151;
    --accent-blue: #3b82f6;
    --accent-green: #34d399;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-base);
    line-height: 1.5;
    padding: 24px;
    transition: background-color 0.2s, color 0.2s;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header Constraints */
.dashboard-header {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: var(--shadow-sm);
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.header-nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover, .nav-link.highlight {
    color: var(--accent-blue);
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.clock {
    font-weight: 600;
    color: var(--accent-blue);
    font-size: 1.1rem;
}

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

/* Buttons */
.btn {
    padding: 6px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-success { background-color: var(--accent-green); color: #fff; }
.btn-danger { background-color: var(--accent-red); color: #fff; }
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-base);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
}

/* Dashboard UI Structure */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.card {
    background-color: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    color: var(--text-base) !important;
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--text-base) !important;
}

/* Grid Layout for Ride Elements */
.ride-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    list-style: none;
}

.ride-item {
    background-color: var(--bg-subtle) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-base);
}

.ride-item strong {
    color: var(--accent-blue) !important;
}

/* WebSocket Toast Framework */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast-alert {
    background-color: var(--accent-green);
    color: #fff;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-weight: 600;
    animation: slideIn 0.3s ease-out, fadeOut 0.5s 4.5s forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}