:root {
    --bg-color: #f0f2f5;
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-color: #1a1a1a;
    --border-color: rgba(0, 0, 0, 0.1);
    --accent: #6c5ce7;
    --toggle-color: #1abc9c;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --card-bg: rgba(30, 30, 30, 0.8);
    --text-color: #ffffff;
    --border-color: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    transition: all 0.4s ease;
}

/* --- PREMIUM HEADER --- */
header {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin: 20px;
    padding: 20px 40px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    letter-spacing: -1px;
}

.controls-panel {
    display: flex;
    gap: 30px;
    align-items: center;
}

.picker-group, .toggle-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modern-input {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
}

/* --- THE CUSTOM TOGGLE --- */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px; width: 20px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--toggle-color); }
input:checked + .slider:before { transform: translateX(22px); }

/* --- THE SMART GRID --- */
.tracker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
}

.day-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.day-card:hover { transform: translateY(-5px); }

.day-title { font-weight: bold; color: var(--accent); margin-bottom: 10px; }

.habit-input {
    width: 100%; padding: 10px; border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-color); color: var(--text-color);
    box-sizing: border-box;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
        text-align: center;
    }
    .controls-panel { flex-direction: column; gap: 15px; }
}
/* --- CALENDAR ICON DARK MODE FIX --- */
[data-theme="dark"] .modern-input::-webkit-calendar-picker-indicator {
    filter: invert(1); /* This turns the black icon white */
    cursor: pointer;
}

/* Optional: Make the input text and icon look more uniform */
.modern-input {
    outline: none;
    transition: border-color 0.3s ease;
}

.modern-input:focus {
    border-color: var(--accent);
}