:root {
    /* Color Palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --accent-color: #007bff;
    --sidebar-bg: #fdfdfd;
    --sidebar-text: #333333;
    --item-bg: #fff;
    --item-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); /* Subtle shadow */
    --todo-border: #eee;
    --todo-btn-bg: #333;
    --todo-btn-text: #fff;
    --transition-speed: 0.3s;
}

body.dark-mode {
    --bg-primary: #000000;
    --bg-secondary: #121212;
    --text-primary: #e9ecef;
    --text-secondary: #adb5bd;
    --accent-color: #3d8bfd;
    --sidebar-bg: #111111;
    --sidebar-text: #f0f0f0;
    --item-bg: #1d1d1d;
    --item-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --todo-border: #333;
    --todo-btn-bg: #444;
    --todo-btn-text: #fff;
}

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

body {
    font-family: 'Inter', 'Outfit', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    overflow: hidden;
    height: 100vh;
}

.container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Gallery Area */
.gallery {
    flex: 1;
    display: flex;
    overflow: hidden;
    gap: 1px; /* Subtle line between images */
    background: #000;
}

.gallery-image {
    flex: 1 1 0;
    width: 0;
    height: 100%;
    object-fit: cover;
    transition: filter 0.5s ease;
    min-width: 0;
}

/* Sidebar */
.sidebar {
    width: 280px; /* Reduced from 320px */
    height: 100vh;
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    box-shadow: -1px 0 10px rgba(0, 0, 0, 0.03); /* Extremely subtle shadow */
    z-index: 10;
    border-left: 1px solid var(--todo-border);
}

.sidebar-header {
    margin-bottom: 2rem;
}

.controls-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.image-count-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stepper {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid var(--todo-border);
}

#imageCountDisplay {
    font-size: 0.8rem;
    min-width: 1.5rem;
    text-align: center;
    font-weight: 700;
}

/* Calendar Section */
.calendar-section {
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.weather-widget {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
    font-weight: 500;
}

.weather-widget .weather-temp {
    font-weight: 700;
    color: var(--text-primary);
}

.weather-widget .weather-city {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.calendar-header {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.calendar-body {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.day-number {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    font-family: 'Outfit', sans-serif;
}

.week-day {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.05rem;
}

/* Calendar Section */
.calendar-section {
    color: var(--text-primary);
}

.calendar-header {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.calendar-body {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.day-number {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    font-family: 'Outfit', sans-serif;
}

.week-day {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.05rem;
}

/* Footer / Reload */
.sidebar-footer {
    display: flex;
    justify-content: flex-end;
}

/* Common Components */
.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        height: 100dvh;
    }
    .gallery {
        height: 85vh; /* Maximize gallery area */
    }
    .sidebar {
        width: 100%;
        max-width: 100%;
        height: 15vh; /* Compact footer */
        padding: 0.5rem 1rem 0.5rem 0; /* Left padding set to 0 */
        flex-direction: row; /* Single row */
        justify-content: space-between;
        align-items: center;
        overflow: hidden;
        border-left: none;
        border-top: 1px solid var(--todo-border);
    }
    .sidebar-header {
        margin-bottom: 0;
        order: 2; /* Move controls to the right */
    }
    .controls-top {
        gap: 0.8rem;
    }
    .calendar-section {
        order: 1; /* Move calendar to the left */
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .weather-widget {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }
    .weather-widget .weather-city {
        font-size: 0.75rem;
    }
    .calendar-body {
        gap: 0.5rem;
    }
    .day-number {
        font-size: 2.8rem; /* Further reduced for single line */
    }
    .week-day {
        font-size: 0.8rem;
    }
    .calendar-header {
        font-size: 0.6rem;
        margin-bottom: 0;
    }
}
