/* 
   CookBookie - Main Stylesheet
   Valentina Biviano
   April 2026 
*/

html {
    background-color: #f0fdf4;
}

/* prevents the {{ }} flash */
[v-cloak] {
    display: none;
}

/* Variables */
:root {
    --bg-main: #f0fdf4;
    --sidebar-bg: #fff5eb;
    --accent-pink: #fce7f3;
    --accent-lavender: #f3e8ff;
    --accent-blue: #e0f2fe;
    --accent-yellow: #fef3c7;
    --text-dark: #4a4a4a;
    --text-muted: #888;
    --white: #ffffff;
    --orange: #d97706;
    --border-light: #ffe0c2;
    --sidebar-width: 260px;
    --mobile-header-height: 60px;
}

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

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
}

/* APP LAYOUT GRID (Desktop) */
.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

/* MOBILE HEADER BAR*/
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mobile-header-height);
    background-color: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

.mobile-logo {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--orange);
    text-decoration: none;
}

/* HAMBURGER BUTTON*/
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    gap: 5px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.hamburger-btn:hover,
.hamburger-btn:focus {
    background-color: rgba(217, 119, 6, 0.1);
    outline: none;
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hamburger → X animation */
.hamburger-btn.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.is-open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-btn.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* OVERLAY (mobile nav backdrop)*/
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.nav-overlay.is-visible {
    display: block; 
    opacity: 1;
}

/* SIDEBAR / ASIDE */
aside {
    background-color: var(--sidebar-bg);
    padding: 2rem;
    border-right: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.logo-area h1 {
    font-size: 1.4rem;
    letter-spacing: 1px;
    margin-bottom: 2rem;
    color: var(--orange);
}

nav ul {
    list-style: none;
}

nav li a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 6px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px;
}

nav li a:hover,
nav li a.active {
    background-color: var(--white);
    transform: translateX(5px);
}

/*MAIN CONTENT*/
main {
    padding: 2.5rem;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
    align-items: start;
}

main.full-width {
    grid-template-columns: 1fr;
}

h2 {
    margin-bottom: 1.5rem;
    font-weight: 600;
}

h3 {
    margin-bottom: 1rem;
}

/* RECIPE CARDS*/
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.card {
    background: var(--white);
    padding: 1.2rem;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    cursor: pointer;
    color: var(--orange);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.card-text-left {
    text-align: left;
}

/* CATEGORY CARD IMAGE (Dashboard) */
.img-placeholder {
    height: 140px;
    border-radius: 15px;
    margin-bottom: 12px;
    background-color: var(--accent-lavender);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.category-icon {
    width: 88px;
    height: 88px;
    object-fit: contain;
    display: block;
}

/* RECIPE CARD MEDIA (Recipes page) */
.recipe-card-media {
    height: 140px;
    border-radius: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.recipe-card-media img.illustration {
    width: 88px;
    height: 88px;
    object-fit: contain;
}

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

/* DELETE button on recipe cards */
.btn-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-delete .material-symbols-rounded {
    font-size: 1.1rem;
    margin: 0;
    color: #e53e3e;
}

.card:hover .btn-delete {
    opacity: 1;
}

/* Always show delete button on touch devices */
@media (hover: none) {
    .btn-delete {
        opacity: 1;
    }
}

.btn-delete:hover {
    background: #fff0f0;
}

.recipe-category-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ================================================
   FORM PANEL
   ================================================ */
.form-panel {
    background: var(--white);
    padding: 2rem;
    border-radius: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    height: fit-content;
}

/* Form elements */
label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 5px;
    margin-top: 1rem;
    font-weight: bold;
}

label:first-of-type {
    margin-top: 0;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #f1f1f1;
    background: #fafafa;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

select {
    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'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--orange);
}

input.form-error,
select.form-error,
textarea.form-error {
    border-color: #e53e3e;
    background: #fff5f5;
}

.error-msg {
    display: block;
    color: #e53e3e;
    font-size: 0.8rem;
    margin-top: 4px;
    margin-bottom: 8px;
}

.btn-submit {
    width: 100%;
    background-color: var(--accent-pink);
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 1rem;
    margin-top: 1.5rem;
    color: var(--text-dark);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 48px;
}

.btn-submit:hover {
    background-color: #fbcfe8;
}

.btn-logout {
    width: 100%;
    background-color: var(--accent-pink);
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 1rem;
    margin-top: 1rem;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 48px;
}

.btn-logout:hover {
    background-color: #e64141;
    color: white;
}

/* ================================================
   ICONS
   ================================================ */
.material-symbols-rounded {
    vertical-align: middle;
    margin-right: 8px;
    font-size: 1.3rem;
    color: #5c626f;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

nav li a:hover .material-symbols-rounded,
nav li a.active .material-symbols-rounded {
    color: var(--orange);
}

/* ================================================
   FILTER BAR (Recipes Page)
   ================================================ */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: white;
    border: 1px solid #eee;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 40px;
}

.filter-btn.active,
.filter-btn:hover {
    background-color: var(--accent-pink);
    border-color: var(--accent-pink);
    font-weight: bold;
}

/* RECIPES PAGE HEADER */
.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ================================================
   "ADD RECIPE" FORM
   ================================================ */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Photo Upload */
.upload-area {
    border: 2px dashed #ddd;
    padding: 40px 20px;
    text-align: center;
    border-radius: 15px;
    background: #fafafa;
    margin-bottom: 20px;
    cursor: pointer;
    transition: border-color 0.2s;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.upload-area:hover {
    border-color: var(--orange);
}

.upload-area.has-photo {
    padding: 0;
    border-style: solid;
    border-color: var(--border-light);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.upload-placeholder .material-symbols-rounded {
    font-size: 2.5rem;
    margin: 0;
    color: #bbb;
}

.upload-preview-img {
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
    display: block;
    border-radius: 13px;
}

.file-input-hidden {
    display: none;
}

.form-message {
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
    padding: 12px;
    border-radius: 10px;
}

.form-message.success {
    color: #15803d;
    background: #f0fdf4;
}

.form-message.error {
    color: #e53e3e;
    background: #fff5f5;
}

/* ================================================
   SETTINGS PAGE
   ================================================ */
.settings-card {
    text-align: left;
    margin-bottom: 20px;
    padding: 1.5rem;
}

.settings-card h3 {
    margin-bottom: 0.5rem;
}

.settings-card p {
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-row input[type="checkbox"] {
    width: auto;
    margin: 0;
    min-height: auto;
    appearance: auto;
    -webkit-appearance: auto;
}

/* ================================================
   DATE/TIME WIDGET (Dashboard)
   ================================================ */
.date-widget {
    background: var(--white);
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.date-widget p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.date-widget-time {
    font-size: 2rem;
    font-weight: 700;
    color: var(--orange);
    line-height: 1;
}

.date-widget-date {
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-top: 4px;
}

/* ================================================
   TABLE (Nutrition Page)
   ================================================ */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    font-size: 0.9rem;
    min-width: 480px;
}

caption {
    caption-side: top;
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem;
    background: var(--white);
    text-align: left;
    color: var(--text-dark);
}

thead th {
    background-color: var(--sidebar-bg);
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--orange);
    border-bottom: 2px solid var(--border-light);
}

tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background-color: #fffbf5;
}

tbody td {
    padding: 12px 16px;
    color: var(--text-dark);
}

/* ================================================
   ACCORDION (Nutrition Page)
   ================================================ */
.accordion {
    margin-bottom: 2rem;
}

.accordion-item {
    background: var(--white);
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
    color: var(--text-dark);
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 48px;
}

.accordion-header:hover {
    background-color: #fffbf5;
}

.accordion-header.active {
    background-color: var(--sidebar-bg);
    color: var(--orange);
}

.accordion-icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    display: none;
    padding: 1rem 1.5rem 1.2rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-muted);
    border-top: 1px solid #f5f5f5;
}

.external-link-block {
    background: var(--accent-blue);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.external-link-block p {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.external-link-block a {
    color: #0369a1;
    font-weight: 600;
    text-decoration: underline;
}

/* ================================================
   SLIDESHOW (Tips Page)
   ================================================ */
.slideshow-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    background: #000;
}

.slide {
    display: none;
    position: relative;
}

.slide:first-child {
    display: block;
}

.slide img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
    opacity: 0.8;
}

.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    color: var(--white);
    padding: 2rem 2rem 1.5rem;
}

.slide-caption h3 {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
    color: var(--white);
}

.slide-caption p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.slideshow-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.slide-btn {
    background: var(--white);
    border: 1px solid #eee;
    padding: 8px 22px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px;
}

.slide-btn:hover {
    background: var(--accent-pink);
    border-color: var(--accent-pink);
}

.slide-counter {
    background: var(--white);
    border: 1px solid #eee;
    padding: 8px 22px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

/* Tips Cards */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.tip-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.3rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tip-card h4 {
    margin-bottom: 0.5rem;
    color: var(--orange);
}

.tip-card p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ================================================
   CONTACT FORM PAGE
   ================================================ */
.contact-intro {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.contact-intro p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted);
}

/* ================================================
   CONFIRMATION PAGE
   ================================================ */
.confirm-container {
    max-width: 600px;
    margin: 0 auto;
}

.confirm-card {
    background: var(--white);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
}

.confirm-icon {
    font-size: 3rem;
    color: #22c55e;
    margin-bottom: 1rem;
    text-align: center;
    display: block;
}

.confirm-greeting {
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.confirm-details {
    border-top: 1px solid #f0f0f0;
    padding-top: 1.5rem;
}

.confirm-row {
    display: flex;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.confirm-label {
    font-weight: 600;
    min-width: 140px;
    color: var(--text-muted);
}

.confirm-value {
    color: var(--text-dark);
    flex: 1;
    word-break: break-word;
}

.confirm-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn-back,
.btn-back-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    flex: 1;
    justify-content: center;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-back {
    background-color: var(--accent-pink);
    color: var(--text-dark);
}

.btn-back:hover {
    background-color: #fbcfe8;
}

.btn-back-secondary {
    background-color: var(--accent-blue);
    color: var(--text-dark);
}

.btn-back-secondary:hover {
    background-color: #bae6fd;
}

.btn-back .material-symbols-rounded,
.btn-back-secondary .material-symbols-rounded {
    margin: 0;
    font-size: 1.1rem;
}

/* ================================================
   RECIPE DETAIL PAGES
   ================================================ */
.recipe-detail {
    max-width: 700px;
    margin: 0 auto;
}

.recipe-detail-header {
    margin-bottom: 2rem;
}

.recipe-detail-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.recipe-hero {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    display: block;
}

.recipe-meta-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.recipe-meta-badge {
    background: var(--sidebar-bg);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.recipe-section {
    background: var(--white);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.recipe-section h3 {
    margin-bottom: 1rem;
    color: var(--orange);
}

.recipe-section ul,
.recipe-section ol {
    padding-left: 1.2rem;
    line-height: 1.9;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.recipe-section p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.btn-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-dark);
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px;
}

.btn-back-link:hover {
    background: var(--sidebar-bg);
}

/* ================================================
   MODAL (Recipes Page)
   ================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-box {
    background: var(--white);
    border-radius: 24px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    margin: auto;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-muted);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.modal-close:hover {
    background: #f5f5f5;
}

.modal-media {
    height: 200px;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.modal-meta span {
    font-size: 0.85rem;
    background: var(--sidebar-bg);
    padding: 5px 12px;
    border-radius: 20px;
    color: var(--text-muted);
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--orange);
}

.modal-section ul,
.modal-section ol {
    padding-left: 1.2rem;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-muted);
}

/* ================================================
   TABLET BREAKPOINT — 1024px and below
   ================================================ */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 220px 1fr;
    }

    aside {
        padding: 1.5rem;
    }

    main {
        padding: 2rem;
        grid-template-columns: 1fr 280px;
        gap: 2rem;
    }
}

/* ================================================
   MOBILE BREAKPOINT — 768px and below
   ================================================ */
@media (max-width: 768px) {
    /* Show mobile header */
    .mobile-header {
        display: flex;
    }

    /* Show overlay when needed */
    .nav-overlay {
        display: block;
    }

    /* Push content below fixed header */
    body {
        padding-top: var(--mobile-header-height);
    }

    /* Sidebar becomes slide-in drawer */
    .app-container {
        grid-template-columns: 1fr;
    }

    aside {
        position: fixed;
        top: var(--mobile-header-height);
        left: 0;
        bottom: 0;
        width: 280px;
        height: calc(100vh - var(--mobile-header-height));
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        padding: 1.5rem;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }

    aside.is-open {
        transform: translateX(0);
    }

    /* Hide desktop logo inside sidebar on mobile */
    .logo-area {
        display: none;
    }

    /* Single-column main content */
    main {
        padding: 1.25rem;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    main.full-width {
        grid-template-columns: 1fr;
    }

    /* Recipe grids — 2 columns */
    .recipe-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-bottom: 2rem;
    }

    /* Tips grid — 1 column */
    .tips-grid {
        grid-template-columns: 1fr;
    }

    /* Form 2-col → 1-col */
    .form-two-col {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Slideshow */
    .slide img {
        height: 240px;
    }

    .slide-caption h3 {
        font-size: 1.1rem;
    }

    /* Recipe detail */
    .recipe-hero {
        height: 220px;
    }

    .recipe-detail-header h2 {
        font-size: 1.4rem;
    }

    /* Confirm actions — stack */
    .confirm-actions {
        flex-direction: column;
    }

    /* Date widget */
    .date-widget-time {
        font-size: 1.5rem;
    }

    /* Form panel */
    .form-panel {
        padding: 1.25rem;
        border-radius: 16px;
    }

    /* Heading spacing */
    h2 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .page-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Filter bar scrollable */
    .filter-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Modal full width on mobile */
    .modal-box {
        padding: 1.5rem;
        border-radius: 16px;
        max-height: 85vh;
    }

    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .modal-box {
        margin: 0;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        max-height: 90vh;
    }

    /* Recipe section */
    .recipe-section {
        padding: 1.25rem;
    }
}

/* ================================================
   SMALL MOBILE — 480px and below
   ================================================ */
@media (max-width: 480px) {
    /* Recipe grid — 1 column */
    .recipe-grid {
        grid-template-columns: 1fr;
    }

    main {
        padding: 1rem;
    }

    .confirm-card {
        padding: 1.5rem;
    }

    .confirm-label {
        min-width: 110px;
    }

    .slide img {
        height: 200px;
    }

    .recipe-hero {
        height: 180px;
    }

    .date-widget-time {
        font-size: 1.3rem;
    }

    .filter-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .form-container {
        max-width: 100%;
    }
}
