/* 🎨 BiOMA Vault - Dark/Light Theme System */

:root {
    /* Light Mode Colors */
    --bg-gradient-1: #2b961f;
    --bg-gradient-2: #1a5c13;
    --bg-card: #ffffff;
    --bg-card-secondary: #f9fafb;
    --bg-hover: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
    --accent: #2b961f;
    --accent-hover: #1a5c13;
    --accent-shadow: rgba(43, 150, 31, 0.3);
    --error-bg: #fee2e2;
    --error-text: #991b1b;
    --error-border: #fecaca;
    --success-bg: #d1fae5;
    --success-text: #065f46;
    --success-border: #a7f3d0;
}

body.dark-mode {
    /* Dark Mode Colors */
    --bg-gradient-1: #1a1a2e;
    --bg-gradient-2: #16213e;
    --bg-card: #0f172a;
    --bg-card-secondary: #1e293b;
    --bg-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
    --accent: #2b961f;
    --accent-hover: #1a5c13;
    --accent-shadow: rgba(43, 150, 31, 0.5);
    --error-bg: #7f1d1d;
    --error-text: #fecaca;
    --error-border: #991b1b;
    --success-bg: #064e3b;
    --success-text: #a7f3d0;
    --success-border: #065f46;
}

/* Smooth transitions for theme switching */
* {
    transition: background-color 0.3s ease, 
                color 0.3s ease, 
                border-color 0.3s ease,
                box-shadow 0.3s ease !important;
}

/* Apply theme colors */
body {
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
}

/* Cards */
.login-card,
.dashboard-header,
.main-content,
.nav-tab,
.modal-content {
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

.dashboard-header h1,
.login-card h1 {
    color: var(--accent);
}

/* Secondary backgrounds */
.table-stat-card,
.bg-secondary,
th {
    background: var(--bg-card-secondary);
}

/* Hover states */
tr:hover,
.nav-tab:hover,
.table-stat-card:hover {
    background: var(--bg-hover);
}

/* Text colors */
h2, h3, h4, label, .stat-label {
    color: var(--text-primary);
}

p, span, .pagination-info {
    color: var(--text-secondary);
}

/* Borders */
input, select, textarea, table, th, td, .table-wrapper, .table-stat-card {
    border-color: var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
}

/* Alerts */
.alert.error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error-border);
}

.alert.success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-card-secondary);
    border: 2px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.theme-icon {
    font-size: 20px;
    line-height: 1;
}

/* Stat cards keep gradient */
.stat-card {
    background: var(--accent) !important;
    box-shadow: 0 4px 15px var(--accent-shadow);
}

/* Buttons keep their colors */
button {
    background: var(--accent);
}

button:hover {
    background: var(--accent-hover);
}

button.secondary {
    background: var(--text-secondary);
}

button.secondary:hover {
    background: var(--text-muted);
}

/* Table cards */
.table-card {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
}

/* Code blocks in dark mode */
code {
    background: var(--bg-card-secondary);
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 4px;
}
