/* public/css/theme.css */
/* CSS Custom Properties cho Light/Dark mode */

:root {
    /* Light mode (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-sidebar: #ffffff;
    --bg-sidebar-hover: #f1f3f5;
    --bg-sidebar-active: rgba(79, 70, 229, 0.1);
    --bg-header: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #ffffff;

    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-sidebar: #495057;
    --text-sidebar-active: #4f46e5;
    --text-sidebar-heading: #adb5bd;
    --text-link: #4f46e5;

    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-light: rgba(79, 70, 229, 0.1);

    --border-color: #e5e7eb;
    --border-sidebar: #2d3239;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);

    --radius: 8px;
    --radius-lg: 12px;

    --sidebar-width: 260px;
    --header-height: 56px;

    --transition: all 0.2s ease;
}

[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-sidebar: #0d1117;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.05);
    --bg-sidebar-active: rgba(79, 70, 229, 0.25);
    --bg-header: #1f2937;
    --bg-card: #1f2937;
    --bg-input: #374151;

    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-sidebar: #8b949e;
    --text-sidebar-active: #f0f6fc;
    --text-sidebar-heading: #6b7280;
    --text-link: #818cf8;

    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: rgba(99, 102, 241, 0.15);

    --border-color: #374151;
    --border-sidebar: #21262d;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition);
    min-height: 100vh;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card-body {
    padding: 1.25rem;
}

.card-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    font-weight: 600;
}

/* === Tables === */
.table {
    color: var(--text-primary);
}

.table thead th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    border-color: var(--border-color);
    vertical-align: middle;
}

/* === Forms === */
.form-control,
.form-select {
    background: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: var(--bg-input);
    color: var(--text-primary);
}

/* === Buttons === */
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    border-radius: var(--radius);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* === Alerts === */
.alert {
    border-radius: var(--radius);
}

/* === Badges === */
.badge {
    border-radius: var(--radius);
    font-weight: 500;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
