
body[data-theme="dark"] {
    /* All color variables are already handled by the CSS variable system */
}

/* Ensure proper contrast in dark mode for specific elements */
body[data-theme="dark"] .search-bar {
    background-color: var(--surface);
    border-color: var(--border);
}

body[data-theme="dark"] .search-bar input::placeholder {
    color: var(--text-tertiary);
}

body[data-theme="dark"] .input-wrapper {
    background-color: var(--background);
}

/* Ensure buttons work well in dark mode */
body[data-theme="dark"] .btn-outline {
    color: var(--text-primary);
    border-color: var(--border);
}

body[data-theme="dark"] .btn-outline:hover:not(:disabled) {
    background-color: var(--surface-hover);
    color: var(--primary);
}


.dark-mode {
    --clr-bg: #0f172a;
    --clr-surface: #1e293b;
    --clr-text-main: #f8fafc;
    --clr-text-muted: #94a3b8;
    --clr-border: #334155;
    --bg-stat-box: #334155;
    --text-brand: #38bdf8;
    --button-primary-bg: #0284c7;
    --button-primary-hover: #0369a1;
    --button-cancel-bg: #334155;
    --button-cancel-text: #f8fafc;
    --bg-available: #064e3b;
    --text-available: #34d399;
    --bg-limited: #78350f;
    --text-limited: #fbbf24;
}

.dark-mode .navbar {
    background: #1e293b;
}

.dark-mode input,
.dark-mode textarea,
.dark-mode select {
    background: #334155;
    color: white;
    border-color: #475569;
}

.dark-mode .emergency-grid button {
    background: #334155;
    border-color: #475569;
    color: #f8fafc;
}

.dark-mode .emergency-grid button:hover {
    background: #450a0a;
}

.theme-btn {
    /* REMOVE: position: absolute; */
    /* REMOVE: right: 20px; */
    /* REMOVE: top: 20px; */
    
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.1rem;
    display: inline-flex; /* Ensures content centers nicely if needed */
    align-items: center;
}

.theme-btn:hover {
    background: rgba(255,255,255,0.3);
}

.dark-mode .navbar {
    background: #1e293b;
}
