:root {
    --color-bg: #faf3ea;
    --color-surface: #fffaf3;
    --color-text: #4a372c;
    --color-text-muted: #8b7355;
    --color-primary: #c97b63;
    --color-primary-hover: #b3654e;
    --color-accent: #e8b4b8;
    --color-border: #ecdfce;
    --radius: 18px;
    --shadow: 0 4px 16px rgba(120, 90, 60, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, ui-rounded, "SF Pro Rounded", "Nunito",
        "Segoe UI", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background 800ms ease;
}

/* Weer-gebaseerde achtergrond -- blijft altijd binnen het warme palet,
   varieert alleen toon/helderheid per weertype. Vaste achtergrond zodat de
   gradient niet meescrollt met lange pagina's. */
body.weather-zonnig {
    background: linear-gradient(160deg, #fff6e4 0%, #ffe9c2 45%, #fbdba0 100%);
    background-attachment: fixed;
}

body.weather-bewolkt {
    background: linear-gradient(160deg, #f5efe5 0%, #ece2d3 55%, #e2d5c4 100%);
    background-attachment: fixed;
}

body.weather-regen {
    background: linear-gradient(160deg, #e9e3dd 0%, #dcd4cc 55%, #cec4ba 100%);
    background-attachment: fixed;
}

body.weather-sneeuw {
    background: linear-gradient(160deg, #fdfbf8 0%, #f3f1ec 55%, #e9ede9 100%);
    background-attachment: fixed;
}

body.weather-onweer {
    background: linear-gradient(160deg, #ddd0c6 0%, #c7b6a9 55%, #b3a094 100%);
    background-attachment: fixed;
}

body.weather-mist {
    background: linear-gradient(160deg, #eee8e0 0%, #e2dbd1 55%, #d6cdc2 100%);
    background-attachment: fixed;
}

body.weather-nacht {
    background: linear-gradient(160deg, #ddb9ae 0%, #c99a94 55%, #a97b7c 100%);
    background-attachment: fixed;
}

a {
    color: var(--color-primary);
}

.container {
    max-width: 560px;
    margin: 0 auto;
    padding: 1.25rem;
}

#season-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
}

.app-header .brand {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
    color: var(--color-text);
    text-decoration: none;
}

.app-nav {
    position: relative;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 150ms ease;
}

.menu-toggle:hover {
    background: var(--color-surface);
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 0 auto;
    background: var(--color-text);
    border-radius: 2px;
}

.nav-menu {
    position: absolute;
    top: 100%;
    right: 1.25rem;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.5rem;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms ease;
    z-index: 20;
}

.nav-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-menu a {
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background-color 150ms ease, color 150ms ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: var(--color-bg);
    color: var(--color-primary);
}

.nav-menu .divider {
    height: 1px;
    background: var(--color-border);
    margin: 0.4rem 0.25rem;
}

.card {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.season-badge {
    position: absolute;
    top: -16px;
    right: 10px;
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 3px 4px rgba(74, 55, 44, 0.3));
    animation: badge-in 400ms ease-out forwards;
    pointer-events: none;
    z-index: 5;
}

@keyframes badge-in {
    from {
        opacity: 0;
        transform: translateY(-6px) rotate(var(--badge-rotate, 0deg)) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(var(--badge-rotate, 0deg)) scale(1);
    }
}

.flash {
    background: var(--color-accent);
    color: var(--color-text);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    animation: fade-in 200ms ease-out;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.35rem;
}

input[type="text"],
input[type="password"],
input[type="date"] {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font-size: 1rem;
    background: #fff;
    color: var(--color-text);
    margin-bottom: 1rem;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(201, 123, 99, 0.15);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--color-text);
    margin-bottom: 1rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

.countdown-card {
    text-align: center;
    background: linear-gradient(135deg, var(--color-accent), var(--color-surface));
    margin-bottom: 1.5rem;
}

.countdown-days {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
}

.timer-card {
    text-align: center;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    margin-bottom: 1.5rem;
}

.timer-card .text-muted.small {
    color: rgba(74, 55, 44, 0.75);
}

.timer-display {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin: 0.5rem 0 0.25rem;
}

.timer-clock {
    font-size: 1.7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #fff;
    margin: 0 0 1rem;
    letter-spacing: 0.03em;
}

.timer-card details {
    margin: 0;
}

.timer-card summary {
    color: #fff;
    opacity: 0.85;
}

.timer-card form {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.timer-card input[type="date"] {
    width: auto;
    margin-bottom: 0;
}

.dashboard-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin: 0.75rem 0 1.5rem;
}

.dashboard-link {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    transition: transform 150ms ease;
}

.dashboard-link:hover {
    transform: translateY(-2px);
}

button,
.btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 150ms ease, transform 150ms ease;
}

button:hover,
.btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

button:active,
.btn:active {
    transform: translateY(0);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font: inherit;
    color: var(--color-text);
    background: #fff;
    resize: vertical;
    margin-bottom: 0.75rem;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(201, 123, 99, 0.15);
}

.composer {
    margin-bottom: 1.5rem;
}

.composer label[for="text"] {
    margin-bottom: 0.5rem;
}

.composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.btn-secondary {
    display: inline-block;
    background: transparent;
    color: var(--color-text-muted);
    border: 1px dashed var(--color-border);
    border-radius: 999px;
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 150ms ease, color 150ms ease;
}

.btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.on-this-day {
    background: linear-gradient(135deg, var(--color-accent), var(--color-surface));
    margin-bottom: 1.5rem;
}

.on-this-day h2 {
    margin-top: 0;
    font-size: 1.05rem;
}

.timeline-date {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin: 1.5rem 0 0.75rem;
}

.moment {
    margin-bottom: 1rem;
    animation: fade-in 200ms ease-out;
}

.moment-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0 0 0.5rem;
}

.moment-photo {
    display: block;
    width: 100%;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.empty-state {
    color: var(--color-text-muted);
    text-align: center;
    padding: 2rem 0;
}

select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font: inherit;
    color: var(--color-text);
    background: #fff;
    margin-bottom: 0.75rem;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(201, 123, 99, 0.15);
}

.page-intro {
    margin-bottom: 1.25rem;
}

.page-intro h1 {
    margin: 0 0 0.35rem;
    font-size: 1.4rem;
}

.text-muted {
    color: var(--color-text-muted);
    margin: 0 0 0.5rem;
}

.link-muted {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-decoration: none;
}

.link-muted:hover {
    color: var(--color-primary);
}

details {
    margin-bottom: 1rem;
}

details > summary {
    cursor: pointer;
    list-style: none;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

details > summary::-webkit-details-marker {
    display: none;
}

details[open] > summary {
    margin-bottom: 0.85rem;
}

.composer-disclosure form {
    margin-top: 0.5rem;
}

.filter-row {
    display: flex;
    gap: 0.75rem;
}

.filter-row > div {
    flex: 1;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-bar select {
    width: auto;
    margin-bottom: 0;
    flex: 1;
    min-width: 140px;
}

.tag-row {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.tag {
    display: inline-block;
    background: var(--color-bg);
    color: var(--color-text-muted);
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.78rem;
}

.random-pick-btn {
    width: 100%;
    margin-bottom: 1.25rem;
}

.random-pick-btn:disabled {
    background: var(--color-border);
    color: var(--color-text-muted);
    cursor: not-allowed;
    transform: none;
}

.generator-card {
    margin-bottom: 1rem;
    transition: box-shadow 300ms ease, border-color 300ms ease;
}

.generator-card h3 {
    margin: 0 0 0.4rem;
}

.generator-card.picked {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(201, 123, 99, 0.25), var(--shadow);
    animation: pop 400ms ease;
}

.done-disclosure summary {
    font-size: 0.85rem;
}

.item-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.item-actions:has(details[open]) {
    flex-direction: column;
}

.item-actions details {
    margin: 0;
}

.item-actions .edit-disclosure summary {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.delete-form {
    margin: 0;
}

.btn-delete {
    background: none;
    border: none;
    color: #a8433a;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    border-radius: 8px;
    transition: color 150ms ease, background-color 150ms ease;
}

.btn-delete:hover {
    background: rgba(168, 67, 58, 0.1);
    transform: none;
}

.rating {
    color: var(--color-primary);
    letter-spacing: 0.1em;
    margin: 0 0 0.5rem;
}

.done-note {
    color: var(--color-text-muted);
    font-style: italic;
}

.generator-list.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.85rem;
}

.generator-list.grid .generator-card {
    padding: 0;
    overflow: hidden;
    margin-bottom: 0;
}

.generator-list.grid .generator-card .card-body {
    padding: 0.85rem;
}

.generator-list.grid .generator-card h3 {
    font-size: 0.95rem;
    margin: 0 0 0.3rem;
}

.generator-list.grid .generator-card p {
    font-size: 0.85rem;
}

.poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    background: var(--color-border);
}

.poster-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, var(--color-accent), var(--color-bg));
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.75rem;
}

.map-card {
    margin-bottom: 1.5rem;
    /* Leaflet's eigen panes/controls gebruiken vrij hoge z-indexen (tot
       1000). isolation:isolate maakt hier een eigen stacking context van
       zodat die nooit boven de hamburgermenu of seizoensbadge uitsteken. */
    position: relative;
    isolation: isolate;
}

.place-results {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    margin: -0.5rem 0 0.75rem;
}

.place-results.open {
    display: flex;
}

.place-result {
    text-align: left;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    color: var(--color-text);
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease;
}

.place-result:hover {
    background: var(--color-bg);
    border-color: var(--color-primary);
    transform: none;
}

#bucketlist-map {
    width: 100%;
    height: 280px;
    border-radius: 12px;
    background: #dfe6e0;
}

.bucketlist-pin {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.bucketlist-pin.done {
    background: var(--color-text-muted);
}

.bucketlist-pin-photo img {
    /* !important nodig: Leaflet's eigen .leaflet-marker-pane img regel zet
       "width: auto" met hogere specificity dan een enkele classname. */
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.bucketlist-pin-photo.done img {
    border-color: var(--color-text-muted);
}

.leaflet-popup-content .popup-photo {
    display: block;
    width: 100%;
    max-width: 160px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.4rem;
}

.mood-photo {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.generator-card:has(> .mood-photo) {
    padding: 0;
    overflow: hidden;
}

.generator-card:has(> .mood-photo) > .card-body {
    padding: 1.5rem;
}

.season-tag {
    display: inline-block;
    margin-bottom: 0.75rem;
}

.progress-row {
    margin-top: 1rem;
}

.progress-bar {
    height: 10px;
    border-radius: 999px;
    background: var(--color-bg);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 999px;
    transition: width 300ms ease;
}

.progress-label {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-align: center;
}

.text-muted.small {
    font-size: 0.78rem;
}

.done-item {
    opacity: 0.75;
}

.preserve-lines {
    white-space: pre-line;
}

.tile-rating {
    color: var(--color-primary);
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    margin: 0 0 0.3rem;
}

@keyframes pop {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
