/**
 * Theme System CSS Variables
 * Supports both light and dark modes
 */

:root {
    /* Dark theme (default) */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-panel: #1a1a1a;
    --bg-hover: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #e5e5e5;
    --text-light: #b0b0b0;
    --border-color: rgba(220, 56, 44, 0.2);
    --border-hover: rgba(220, 56, 44, 0.4);
    --accent: #dc382c;
    --accent-hover: #ff4d3d;
    --accent-light: rgba(220, 56, 44, 0.2);
    --shadow: rgba(220, 56, 44, 0.1);
    --shadow-hover: rgba(220, 56, 44, 0.2);
}

/* Light theme */
.theme-light {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-panel: #ffffff;
    --bg-hover: #f1f3f5;
    --text-primary: #1a1a1a;
    --text-secondary: #495057;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --border-hover: #adb5bd;
    --accent: #dc382c;
    --accent-hover: #b82e24;
    --accent-light: #f8d7da;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
}

/* Theme toggle button */
.theme-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 1000;
    transition: all 0.3s ease;
    font-size: 20px;
}

.theme-toggle-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
    box-shadow: 0 6px 16px var(--shadow-hover);
}

.theme-toggle-btn .theme-icon-light,
.theme-toggle-btn .theme-icon-dark {
    position: absolute;
    transition: opacity 0.3s ease;
}

.theme-toggle-btn .theme-icon-light {
    display: none;
}

.theme-light .theme-toggle-btn .theme-icon-light {
    display: inline-block;
}

.theme-light .theme-toggle-btn .theme-icon-dark {
    display: none;
}

/* Apply theme variables to body */
body {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Override inline styles for login pages */
.auth-body,
body.auth-body {
    background: var(--bg-primary) !important;
}

.auth-container {
    background: var(--bg-panel) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

.logo h1,
.auth-subtitle,
.form-group label {
    color: var(--text-primary) !important;
}

.input-group input,
.form-group input {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.input-group input:focus,
.form-group input:focus {
    border-color: var(--accent) !important;
}

.text-muted {
    color: var(--text-light) !important;
}

/* Update common elements */
.bg-redis-bg {
    background-color: var(--bg-primary) !important;
}

.bg-redis-panel {
    background-color: var(--bg-panel) !important;
}

.text-redis-text {
    color: var(--text-primary) !important;
}

.text-redis-text-light {
    color: var(--text-secondary) !important;
}

.border-redis-red\/20 {
    border-color: var(--border-color) !important;
}

.border-redis-red\/30 {
    border-color: var(--border-hover) !important;
}

.bg-redis-red {
    background-color: var(--accent) !important;
}

.bg-redis-red\/20 {
    background-color: var(--accent-light) !important;
}

.text-redis-red {
    color: var(--accent) !important;
}

.hover\:bg-redis-bg:hover {
    background-color: var(--bg-hover) !important;
}

.hover\:bg-redis-red\/20:hover {
    background-color: var(--accent-light) !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Input fields */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="date"],
input[type="time"],
textarea,
select {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent) !important;
    outline: none;
}

/* Cards and panels */
.bg-redis-panel,
.bg-redis-bg {
    box-shadow: 0 2px 8px var(--shadow);
}

/* Links */
a {
    color: var(--accent);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* Buttons */
button,
.btn {
    transition: all 0.2s ease;
}

/* Tables */
table {
    background-color: var(--bg-panel);
}

thead {
    background-color: var(--bg-secondary);
}

tbody tr:hover {
    background-color: var(--bg-hover);
}

/* Modals */
.modal,
[class*="modal"] {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--bg-panel);
    color: var(--text-primary);
}

/* Tooltips */
.tippy-box[data-theme~='dark'] {
    background-color: var(--bg-panel) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Status badges */
.bg-green-500\/20 {
    background-color: rgba(34, 197, 94, 0.2) !important;
}

.bg-yellow-500\/20 {
    background-color: rgba(234, 179, 8, 0.2) !important;
}

.bg-red-500\/20 {
    background-color: rgba(239, 68, 68, 0.2) !important;
}

.bg-blue-500\/20 {
    background-color: rgba(59, 130, 246, 0.2) !important;
}

.theme-light .bg-green-500\/20 {
    background-color: rgba(34, 197, 94, 0.15) !important;
}

.theme-light .bg-yellow-500\/20 {
    background-color: rgba(234, 179, 8, 0.15) !important;
}

.theme-light .bg-red-500\/20 {
    background-color: rgba(239, 68, 68, 0.15) !important;
}

.theme-light .bg-blue-500\/20 {
    background-color: rgba(59, 130, 246, 0.15) !important;
}

