/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===== LUCIDE ICONS ===== */
[data-lucide] {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    vertical-align: middle;
}

:root {
    --peach-bg: #FFD3AC;
    --rose-accent: #FFB5AB;
    --terracotta: #E39A7B;
    --gold: #DBB06B;
    --white: #FFFFFF;
    --charcoal: #2D2D2D;
    --grey-light: #F5F5F5;
    --grey-mid: #E0E0E0;
    --grey-text: #888;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --nav-height: 64px;
    --fab-bottom: 80px;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--grey-light);
    color: var(--charcoal);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + 16px);
    -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
.content {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 16px 24px;
}

/* ===== TYPOGRAPHY ===== */
h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--charcoal);
}

h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

h3 {
    font-size: 1rem;
    font-weight: 600;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.date-display {
    color: var(--grey-text);
    font-size: 0.9rem;
    width: 100%;
}

.link-recipes {
    font-size: 0.85rem;
    color: var(--terracotta);
    text-decoration: none;
    font-weight: 500;
}

/* ===== FLASH MESSAGES ===== */
.flash-messages {
    margin-bottom: 12px;
}

.flash {
    background: var(--rose-accent);
    color: var(--charcoal);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

/* ===== ROOM CARDS (Today) ===== */
.room-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.room-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    color: var(--charcoal);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--terracotta);
    transition: transform 0.15s;
}

.room-card:active {
    transform: scale(0.98);
}

.room-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.room-card-header h2 {
    font-size: 1.1rem;
    margin-bottom: 0;
}

.task-count {
    font-size: 0.9rem;
    color: var(--grey-text);
}

/* ===== BADGES ===== */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.badge-overdue {
    background: var(--gold);
    color: var(--charcoal);
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.tab {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--grey-text);
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.tab.active {
    color: var(--terracotta);
    border-bottom-color: var(--terracotta);
    background: var(--peach-bg);
}

/* ===== DATE NAV ===== */
.date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.date-nav-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--terracotta);
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50%;
}

.date-nav-btn:active {
    background: var(--peach-bg);
}

.date-nav-current {
    font-weight: 600;
    font-size: 1rem;
}

/* ===== SECTION TITLES ===== */
.section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--grey-text);
    margin-bottom: 8px;
    padding: 0 4px;
    cursor: pointer;
}

/* ===== TASK ITEMS ===== */
.tasks-section,
.overdue-section {
    margin-bottom: 20px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    box-shadow: var(--shadow);
}

.task-item.completed .task-name {
    text-decoration: line-through;
    color: var(--grey-text);
}

.task-item.overdue {
    background: #FFF8E7;
    border-left: 3px solid var(--gold);
}

.task-check-form {
    display: flex;
}

.task-checkbox {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-icon {
    display: block;
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--grey-mid);
    border-radius: 5px;
    background: var(--white);
    position: relative;
}

.checkbox-icon.checked {
    background: var(--terracotta);
    border-color: var(--terracotta);
}

.checkbox-icon.checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid var(--white);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

/* Buy item check icons (Lucide circle / circle-check) */
.buy-check {
    color: var(--grey-mid);
}

.buy-check svg,
.buy-check [data-lucide] {
    width: 24px;
    height: 24px;
}

.bought-check {
    color: var(--terracotta);
}

.task-name {
    flex: 1;
    font-size: 0.95rem;
}

.inline-form {
    display: inline;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s;
    min-height: 44px;
}

.btn:active {
    opacity: 0.8;
}

.btn-primary {
    background: var(--terracotta);
    color: var(--white);
}

.btn-secondary {
    background: var(--grey-mid);
    color: var(--charcoal);
}

.btn-danger {
    background: #E57373;
    color: var(--white);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    min-height: 36px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-edit-task {
    color: var(--grey-text);
}

.btn-delete {
    color: #E57373;
}

.btn-icon [data-lucide],
.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* ===== CARD BOX ===== */
.card-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1.5px solid var(--grey-mid);
    margin-top: 20px;
    margin-bottom: 20px;
}

.card-box-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--terracotta);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1.5px solid var(--grey-light);
}

.card-box-title [data-lucide],
.card-box-title svg {
    width: 18px;
    height: 18px;
}

/* ===== FORMS ===== */
.create-section {
    margin-bottom: 20px;
}

.create-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.create-form-inline {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
}

.create-form-inline .input {
    flex: 1;
    min-width: 100px;
}

.create-form-inline .input-small {
    flex: 0 0 70px;
    min-width: 60px;
}

.create-form-inline .btn {
    flex: 0 0 auto;
}

.create-form-stacked {
    flex-direction: column;
}

.form-row-inline {
    display: flex;
    gap: 8px;
}

.form-row-inline .input {
    flex: 1;
    min-width: 80px;
}

.form-row-inline .input-small {
    flex: 0 0 70px;
    min-width: 60px;
}

.btn-full {
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--grey-text);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--grey-text);
}

.input {
    padding: 12px 14px;
    border: 1.5px solid var(--grey-mid);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--white);
    color: var(--charcoal);
    min-height: 48px;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

select.input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.input:focus {
    outline: none;
    border-color: var(--terracotta);
}

.input-small {
    width: 80px;
}

.input-file {
    padding: 10px 0;
    border: none;
    font-size: 0.9rem;
}

.textarea {
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkbox-group-inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    min-height: 32px;
}

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

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* ===== BUY ITEMS ===== */
.buy-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.buy-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.buy-item.bought {
    opacity: 0.5;
}

.buy-item-name {
    flex: 1;
    font-size: 0.95rem;
    min-width: 80px;
}

.quantity-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--grey-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.btn-stepper {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--terracotta);
    cursor: pointer;
}

.btn-stepper [data-lucide],
.btn-stepper svg {
    width: 16px;
    height: 16px;
    stroke-width: 3;
}

.btn-stepper:active {
    background: var(--peach-bg);
}

.quantity-value {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0 6px;
    min-width: 40px;
    text-align: center;
}

.buy-item-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.buy-item-inline .input {
    flex: 1;
}

.buy-item-inline .input-small {
    flex: 0 0 70px;
}

.buy-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.store-label {
    font-size: 0.75rem;
    color: var(--grey-text);
}

/* ===== STORE GROUPS ===== */
.store-group {
    margin-bottom: 20px;
}

.store-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
    margin-bottom: 6px;
}

.store-header svg,
.store-header [data-lucide] {
    width: 18px;
    height: 18px;
    color: var(--terracotta);
    flex-shrink: 0;
}

.store-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    flex: 1;
}

.store-count {
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--grey-mid);
    color: var(--charcoal);
    padding: 2px 8px;
    border-radius: 10px;
}

.bought-history {
    margin-top: 16px;
}

.bought-history summary {
    margin-bottom: 8px;
}

/* ===== ROOM PILLS ===== */
.room-pill {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--peach-bg);
    color: var(--charcoal);
    white-space: nowrap;
}

.room-bedroom { background: #FFD3AC; }
.room-bathroom { background: #B5E0D8; }
.room-study { background: #FFB5AB; }
.room-living-room { background: #E8D5B7; }
.room-kitchen { background: #B5D8CC; }
.room-garage { background: #C5CAE9; }

/* ===== IMPROVEMENTS ===== */
.improvements-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.improvement-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    padding: 12px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.improvement-text {
    flex: 1;
    font-size: 0.95rem;
    min-width: 120px;
}

.improvement-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-make-task {
    background: var(--peach-bg);
    color: var(--charcoal);
    border: none;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    min-height: 36px;
}

/* ===== BOTTOM SHEET ===== */
.bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
}

.bottom-sheet.open {
    display: block;
}

.bottom-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
}

.bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 20px 16px 32px;
    max-height: 85vh;
    overflow-y: auto;
}

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

.btn-close-sheet {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--grey-text);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== TAG FILTER BAR ===== */
.tag-filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tag-filter-bar::-webkit-scrollbar {
    display: none;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    background: var(--white);
    color: var(--charcoal);
    border: 1.5px solid var(--grey-mid);
    transition: background 0.15s;
}

.tag-chip.active {
    background: var(--terracotta);
    color: var(--white);
    border-color: var(--terracotta);
}

/* ===== RECIPE CARDS ===== */
.recipe-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recipe-card {
    display: flex;
    gap: 12px;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--charcoal);
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}

.recipe-card:active {
    transform: scale(0.98);
}

.recipe-card-photo {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--peach-bg);
}

.recipe-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-card-no-photo [data-lucide],
.recipe-card-no-photo svg {
    width: 36px;
    height: 36px;
    color: var(--terracotta);
}

.recipe-card-info {
    padding: 12px 12px 12px 0;
    display: flex;
    align-items: center;
}

.recipe-card-info h3 {
    font-size: 1rem;
}

/* ===== RECIPE DETAIL ===== */
.recipe-hero {
    margin: -16px -16px 16px;
    max-height: 300px;
    overflow: hidden;
}

.recipe-hero img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.recipe-content {
    padding-bottom: 24px;
}

.recipe-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.recipe-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.recipe-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.recipe-section {
    margin-bottom: 24px;
}

.recipe-section h2 {
    font-size: 1.1rem;
    color: var(--terracotta);
    border-bottom: 2px solid var(--peach-bg);
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.recipe-list-numbered {
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.recipe-list-numbered li {
    font-size: 0.95rem;
    line-height: 1.6;
}

.recipe-steps li {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--grey-light);
    margin-bottom: 4px;
}

.recipe-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--grey-text);
}

.empty-hint {
    color: var(--grey-text);
    font-size: 0.9rem;
    padding: 8px 4px;
}

/* ===== FAB ===== */
.fab {
    position: fixed;
    bottom: var(--fab-bottom);
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--terracotta);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 100;
}

.fab [data-lucide],
.fab svg {
    width: 24px;
    height: 24px;
}

.fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--gold);
    color: var(--charcoal);
    font-size: 0.7rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
    z-index: 500;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--grey-text);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 8px 6px;
    min-width: 56px;
    position: relative;
    cursor: pointer;
}

.nav-item.active {
    color: var(--terracotta);
}

.nav-item [data-lucide],
.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-label {
    line-height: 1;
}

/* Rooms dropdown */
.nav-rooms {
    position: relative;
}

.rooms-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
    min-width: 160px;
    padding: 8px 0;
    margin-bottom: 8px;
}

.nav-rooms:hover .rooms-dropdown,
.nav-rooms.open .rooms-dropdown {
    display: block;
}

.rooms-dropdown a {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--charcoal);
    font-size: 0.95rem;
    font-weight: 500;
}

.rooms-dropdown a:active {
    background: var(--peach-bg);
}

/* ===== AUTOCOMPLETE ===== */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--grey-mid);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 150px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow);
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.9rem;
}

.autocomplete-item:active,
.autocomplete-item:hover {
    background: var(--peach-bg);
}

/* ===== WEEKDAY PICKER ===== */
.weekday-picker {
    transition: max-height 0.2s;
}

/* ===== ASK ADRIAAN ===== */
.ask-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ask-item {
    background: var(--white);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: opacity 0.3s, max-height 0.3s;
    max-height: 120px;
}

.ask-item:active {
    background: var(--grey-light);
}

.ask-item-text {
    font-size: 0.95rem;
    flex: 1;
    transition: color 0.2s, text-decoration 0.2s;
}

.ask-done-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ask-countdown-bar {
    height: 3px;
    background: var(--grey-light);
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
    flex-basis: 100%;
}

.ask-countdown-fill {
    height: 100%;
    width: 100%;
    background: var(--terracotta);
    border-radius: 2px;
    transition: width 0.05s linear;
}
