/* DARK MODE STYLES FOR MYCENT */

/* Root variables for easy theme switching */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --button-bg: #2d6a4f;
    --button-hover: #1b4332;
    --shadow: rgba(0, 0, 0, 0.1);
    --accent: #2d6a4f;
}

/* Dark mode variables */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #e4e4e4;
    --text-secondary: #a0a0a0;
    --border-color: #404040;
    --card-bg: #252525;
    --input-bg: #2d2d2d;
    --input-border: #404040;
    --button-bg: #40916c;
    --button-hover: #52b788;
    --shadow: rgba(0, 0, 0, 0.4);
    --accent: #52b788;
}

/* Apply theme variables to all elements */
[data-theme="dark"] body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .container,
[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .charity-item {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: var(--input-bg);
    color: var(--text-primary);
    border-color: var(--input-border);
}

[data-theme="dark"] input::placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] button.primary,
[data-theme="dark"] .btn-primary {
    background-color: var(--button-bg);
}

[data-theme="dark"] button.primary:hover,
[data-theme="dark"] .btn-primary:hover {
    background-color: var(--button-hover);
}

[data-theme="dark"] .donation-item,
[data-theme="dark"] .history-item {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .donation-item:hover,
[data-theme="dark"] .history-item:hover {
    background-color: var(--bg-tertiary);
}

[data-theme="dark"] h1, 
[data-theme="dark"] h2, 
[data-theme="dark"] h3,
[data-theme="dark"] h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .text-muted {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] hr {
    border-color: var(--border-color);
}

/* Dark mode toggle switch */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.theme-toggle label {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
    background-color: #ccc;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-switch.active {
    background-color: #2d6a4f;
}

[data-theme="dark"] .toggle-switch.active {
    background-color: #52b788;
}

.toggle-switch-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.active .toggle-switch-slider {
    transform: translateX(30px);
}

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

/* Smooth transitions for theme changes */
body,
.container,
.card,
input,
select,
textarea,
button {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
