:root {
    /* Monochrome Theme - Light (Default) */
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --accent-black: #000000;
    --accent-inv: #ffffff;
    /* Inverted accent (text on black) */
    --accent-hover: #374151;
    --badge-bg: #e5e7eb;
    --badge-text: #000000;
    --input-bg: #ffffff;

    --header-height: 60px;
    --container-padding: 16px;
}

/* Dark Mode Overrides */
body.dark-mode {
    --bg-color: #000000;
    --card-bg: #121212;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --border-color: #2e2e2e;
    --accent-black: #ffffff;
    --accent-inv: #000000;
    --accent-hover: #e5e5e5;
    --badge-bg: #333333;
    --badge-text: #ffffff;
    --input-bg: #1a1a1a;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

/* --- Header --- */
header {
    height: var(--header-height);
    padding: 0 16px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 20;
    transition: background-color 0.3s;
    border-bottom: 1px solid var(--border-color);
}

.header-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.header-actions {
    display: flex;
    gap: 16px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-primary);
}

/* --- Main Layout --- */
main {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Slider Container */
.slider-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.slider-track {
    display: flex;
    height: 100%;
    width: 200%;
    /* 2 screens */
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.screen {
    width: 50%;
    height: 100%;
    overflow-y: auto;
    padding: var(--container-padding);
    padding-bottom: 80px;
    /* Space for dots/bottom elements */
}

.screen-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 24px;
    margin-top: 8px;
    color: var(--text-primary);
}

/* --- Navigation Arrows --- */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: var(--text-primary);
}

.nav-arrow.left {
    left: 10px;
}

.nav-arrow.right {
    right: 10px;
}

.nav-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

/* --- Pagination Dots --- */
/* ===================== 
   Splash Screen
   ===================== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.splash-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.splash-content {
    text-align: center;
    color: white;
    animation: fadeInUp 0.6s ease-out;
}

.splash-logo {
    font-size: 80px;
    margin-bottom: 20px;
    animation: rotate 2s linear infinite;
}

.splash-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.splash-subtitle {
    font-size: 18px;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 40px;
}

.splash-loader {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loader-bar {
    width: 0%;
    height: 100%;
    background: white;
    border-radius: 2px;
    animation: loadBar 2s ease-in-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes loadBar {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* ===================== 
   Pagination
   ===================== */
.pagination {

    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-color);
    transition: background 0.3s;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    /* Neutral gray */
    transition: background 0.3s;
}

.dot.active {
    background: var(--accent-black);
}

/* --- Task Groups & Cards --- */
.task-group {
    margin-bottom: 24px;
}

.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
}

.group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.group-count {
    background: var(--accent-black);
    color: var(--accent-inv);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

.task-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid transparent;
    transition: box-shadow 0.2s, background-color 0.3s;
}

body.dark-mode .task-card {
    box-shadow: none;
    border: 1px solid var(--border-color);
}

.task-title-row {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 12px;
    line-height: 1.4;
}

.task-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.badges {
    display: flex;
    gap: 8px;
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    background: var(--badge-bg);
    color: var(--badge-text);
}

.task-date {
    color: var(--text-secondary);
}

/* --- Input Area --- */
.add-task-container {
    background: var(--card-bg);
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.input-wrapper {
    margin-bottom: 12px;
}

.styled-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

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

.add-actions {
    display: flex;
    gap: 12px;
}

.select-input {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.add-btn {
    flex: 1;
    background: var(--accent-black);
    color: var(--accent-inv);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-btn:active {
    opacity: 0.9;
}

/* Icons SVG */
.icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.icon-sm {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Modal & Form Styles Updates for Settings */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 0 4px;
}

.settings-section {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.settings-section:last-child {
    border-bottom: none;
}

.section-header-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Toggle Days */
.days-selector {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.day-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    /* Circle */
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card-bg);
    color: var(--text-secondary);
}

.day-toggle.active {
    background: var(--accent-black);
    color: var(--accent-inv);
    border-color: var(--accent-black);
}

/* Time Range */
.time-range-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-input-group {
    flex: 1;
}

.time-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: block;
}

.time-select {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    appearance: none;
}

/* General Settings Item */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.setting-label {
    font-size: 1rem;
    font-weight: 500;
}

.setting-desc {
    /* Small text below label */
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Toggle Switch (IOS Style) */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: var(--accent-black);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

body.dark-mode input:checked+.slider:before {
    background-color: #000;
    /* Knob becomes black used on white accent in dark mode */
}

/* Archive Section */
.archive-section {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.archive-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.archive-header:hover {
    background-color: var(--bg-color);
}

.archive-title {
    flex: 1;
    font-weight: 500;
}

.archive-count {
    background: var(--badge-bg);
    color: var(--badge-text);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.archive-chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.archive-section.collapsed .archive-content {
    display: none;
}

.archive-section.collapsed .archive-chevron {
    transform: rotate(-90deg);
}

.archive-content {
    padding: 0.5rem 0;
}

.archived-task {
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    opacity: 0.7;
    font-size: 0.9rem;
}
