/* ============================================
   MEALCRAFT - MOBILE-FIRST RECIPE APP STYLES
   ============================================

   Table of Contents:
   1. CSS Reset & Variables
   2. Base Styles
   3. Layout & Container
   4. Utility Classes
   5. Navigation (Mobile & Desktop)
   6. Home Page Components
   7. Browse/Results Page Components
   8. Recipe Detail Components
   9. Add Recipe Components
   10. Grocery List Components
   11. Shared Components (Buttons, Cards, Modals)
   12. Media Queries (Responsive)
   ============================================ */

/* ============================================
   1. CSS RESET & VARIABLES
   ============================================ */

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

:root {
    /* ============================================
       COLOR SYSTEM
       ============================================ */

    /* Primary Colors */
    --primary: #f59f3f;
    --primary-dark: #d97706;
    --primary-light: #e3f2fd;

    /* Secondary Colors */
    --secondary: #bfa789;

    /* Text Colors */
    --text: #2f2a28;
    --text-light: #8d8378;
    --text-dark: #1a2b49;

    /* Background Colors */
    --bg: #f5efe6;
    --bg-gradient-start: #f8fafc;
    --bg-gradient-end: #e2e8f0;

    /* Surface Colors */
    --surface: #ffffff;
    --surface-alt: #f9f4ec;

    /* Border Colors */
    --border: #e6dbcf;
    --border-light: #e5e7eb;

    /* Status Colors */
    --success: #10b981;
    --success-light: #48bb78;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --danger-darker: #b91c1c;
    --danger-darkest: #991b1b;

    /* Accent Colors */
    --accent-red: #ff5252;
    --accent-orange: #c2410c;
    --accent-blue: #1d4ed8;
    --accent-blue-light: #4299e1;

    /* Neutral Colors */
    --neutral-dark: #2d3748;
    --white: #ffffff;

    /* ============================================
       TYPOGRAPHY SCALE
       ============================================ */

    /* Mobile Base Typography */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2rem;        /* 32px */
    --text-5xl: 2.25rem;     /* 36px */
    --text-6xl: 3rem;        /* 48px */
    --text-7xl: 3.375rem;    /* 54px */

    /* Additional Common Sizes */
    --text-13: 0.8125rem;    /* 13px */
    --text-15: 0.9375rem;    /* 15px */
    --text-17: 1.0625rem;    /* 17px */
    --text-26: 1.625rem;     /* 26px */
    --text-28: 1.75rem;      /* 28px */

    /* ============================================
       SPACING SCALE
       ============================================ */

    --space-1: 0.25rem;      /* 4px */
    --space-2: 0.5rem;       /* 8px */
    --space-3: 0.75rem;      /* 12px */
    --space-4: 1rem;         /* 16px */
    --space-5: 1.25rem;      /* 20px */
    --space-6: 1.5rem;       /* 24px */
    --space-7: 1.75rem;      /* 28px */
    --space-8: 2rem;         /* 32px */
    --space-10: 2.5rem;      /* 40px */
    --space-12: 3rem;        /* 48px */
    --space-14: 3.5rem;      /* 56px */

    /* Common Spacing Aliases */
    --space-xs: var(--space-1);   /* 4px */
    --space-sm: var(--space-2);   /* 8px */
    --space-md: var(--space-3);   /* 12px */
    --space-lg: var(--space-4);   /* 16px */
    --space-xl: var(--space-6);   /* 24px */
    --space-2xl: var(--space-8);  /* 32px */
    --space-3xl: var(--space-12); /* 48px */

    /* ============================================
       BORDER RADIUS
       ============================================ */

    --radius-sm: 0.5rem;     /* 8px */
    --radius: 1rem;          /* 16px */
    --radius-md: 1.125rem;   /* 18px */
    --radius-lg: 1.75rem;    /* 28px */
    --radius-xl: 2rem;       /* 32px */
    --radius-2xl: 2.25rem;   /* 36px */
    --radius-pill: 999px;    /* Fully rounded */

    /* ============================================
       SHADOWS
       ============================================ */

    --shadow-sm: 0 8px 18px rgba(200, 176, 145, 0.14);
    --shadow: 0 12px 30px rgba(200, 176, 145, 0.18);
    --shadow-lg: 0 24px 44px rgba(200, 176, 145, 0.28);

    /* ============================================
       LAYOUT
       ============================================ */

    --toolbar-height: 72px;
    --sidebar-width: 240px;
    --container-sm: 600px;
    --container-md: 900px;
    --container-lg: 1200px;
    --container-xl: 1400px;

    /* ============================================
       Z-INDEX SCALE
       Use these for consistent layering across the app
       ============================================ */

    --z-dropdown: 50;        /* Dropdown menus, autocomplete */
    --z-sticky: 100;         /* Sticky positioned elements */
    --z-fixed: 200;          /* Fixed positioned elements */
    --z-toolbar: 900;        /* Bottom mobile toolbar */
    --z-timer: 950;          /* Floating step timer */
    --z-loading: 1000;       /* Loading overlay */
    --z-toast: 10000;        /* Toast notifications */
    --z-modal: 20000;        /* Modal dialogs */
}

/* ============================================
   2. BASE STYLES
   ============================================ */

body {
    font-family: 'Exo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Ensure all form elements use the Exo font */
input,
textarea,
select,
button {
    font-family: 'Exo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ============================================
   3. LAYOUT & CONTAINER
   ============================================ */

.container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-alt) 100%);
    padding-bottom: calc(var(--toolbar-height) + env(safe-area-inset-bottom));
    position: relative;
    overflow-x: hidden;
}

/* ============================================
   4. UTILITY CLASSES
   ============================================ */

/* Section Management */
.section {
    display: none;
    padding: 24px;
    padding-bottom: calc(24px + var(--toolbar-height));
    min-height: calc(100vh - var(--toolbar-height));
}

.section.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   5. NAVIGATION (MOBILE & DESKTOP)
   ============================================ */

/* Desktop Navigation - Hidden on mobile, shown on desktop via media query */
.desktop-nav {
    display: none;
}

/* ============================================
   6. HOME PAGE COMPONENTS
   ============================================ */

.home-wrapper {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding-top: 8px;
    padding-bottom: 120px;
}

.home-header {
    display: flex;
    flex-direction: column;
    gap: 0px;
    align-items: center;
}

.home-logo {
    width: 144px;
    height: 144px;
}

.home-pill {
    align-self: center;
    font-family: 'Nunito', sans-serif;
    font-size: 48px;
    font-weight: 400;
    color: var(--text-dark);
    letter-spacing: 0;
    text-transform: none;
    margin-top: -24px;
}

.home-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.home-subtitle {
    font-size: 15px;
    color: var(--text-light);
    text-align: center;
}

.home-search-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow);
}

.search-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface-alt);
    border-radius: 20px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.search-icon {
    display: flex;
    align-items: center;
    color: var(--text-light);
}

.search-input-group input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
}

.search-input-group input::placeholder {
    color: var(--text-light);
}

.search-input-group input:focus {
    outline: none;
}

.search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 16px;
    background: var(--primary);
    color: white;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 12px 20px rgba(245, 159, 63, 0.24);
}

.search-submit svg {
    width: 22px;
    height: 22px;
}

.search-submit:active {
    transform: translateY(1px);
    background: var(--primary-dark);
}

/* ============================================
   HOME CHATBOT
   ============================================ */

.home-chatbot {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.home-chatbot-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 600;
    font-size: var(--text-base);
}

.home-chatbot-header svg {
    width: 20px;
    height: 20px;
}

.home-chat-messages {
    max-height: 400px;
    min-height: 200px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg);
}

.home-chat-message {
    max-width: 90%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: var(--text-sm);
    line-height: 1.5;
}

.home-chat-message p {
    margin: 0;
}

.home-chat-bot {
    align-self: flex-start;
    background: var(--bg-secondary);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.home-chat-user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.home-chat-form {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.home-chat-form input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--bg-secondary);
    font-size: var(--text-sm);
    color: var(--text);
    font-family: inherit;
}

.home-chat-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.home-chat-form input::placeholder {
    color: var(--text-muted);
}

.home-chat-submit {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.home-chat-submit:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.home-chat-submit svg {
    width: 20px;
    height: 20px;
}

/* Recipe cards in chat */
.home-chat-recipes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

/* Loading animation for chat */
.home-chat-loading .loading-dots {
    display: inline-flex;
    gap: 4px;
}

.home-chat-loading .loading-dots span {
    animation: dotPulse 1.4s ease-in-out infinite;
    font-weight: bold;
}

.home-chat-loading .loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.home-chat-loading .loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

.home-categories {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.category-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: 18px;
    border: none;
    font-size: 15px;
    color: var(--text);
    font-weight: 600;
    box-shadow: var(--shadow);
}

.category-btn:active {
    transform: translateY(1px);
}

/* Cooking In Progress Card */
.cooking-in-progress-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    text-decoration: none;
    color: white;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cooking-in-progress-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3);
}

.cooking-in-progress-card:active {
    transform: translateY(0);
}

.cooking-in-progress-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    flex-shrink: 0;
}

.cooking-in-progress-icon svg {
    width: 24px;
    height: 24px;
}

.cooking-in-progress-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cooking-in-progress-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.cooking-in-progress-recipe {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cooking-in-progress-badge {
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    white-space: nowrap;
}

.cooking-in-progress-arrow {
    display: flex;
    align-items: center;
    opacity: 0.8;
    flex-shrink: 0;
}

.cooking-in-progress-arrow svg {
    width: 24px;
    height: 24px;
}

.home-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.home-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.home-section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.home-section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-section-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}

.home-section-action svg {
    width: 16px;
    height: 16px;
}

.home-section-action:hover {
    color: var(--primary);
}

/* Empty State Cards */
.empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 24px;
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: 12px;
    color: var(--text-muted);
    gap: 12px;
}

.empty-state-card svg {
    width: 32px;
    height: 32px;
    stroke: var(--text-muted);
    opacity: 0.6;
}

.empty-state-card p {
    font-size: 15px;
    margin: 0;
}

.empty-state-cta {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    padding: 8px 16px;
    background: var(--primary-light);
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.empty-state-cta:hover {
    background: var(--primary);
    color: white;
}

.empty-state-card-large {
    padding: 48px 32px;
}

.empty-state-card-large h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 4px 0;
}

.empty-state-card-large p {
    max-width: 300px;
    line-height: 1.5;
}

/* Week's Meals Section */
.week-meals-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.week-day-group {
    background: var(--surface);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--border-light);
}

.week-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.week-day-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.week-day-date {
    font-size: 13px;
    color: var(--text-light);
}

.week-day-meals {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.week-meal-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--bg);
    border-radius: 12px;
    color: inherit;
    transition: background 0.2s;
}

.week-meal-item:hover {
    background: var(--border-light);
}

.week-meal-link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.week-meal-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-dark);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}

.week-meal-remove:hover {
    background: rgba(239, 68, 68, 0.18);
}

.week-meal-remove:active {
    transform: scale(0.94);
}

.week-meal-remove svg {
    width: 16px;
    height: 16px;
}

/* Tonight's Dinner Card (matches week-day-group style) */
.tonight-meals-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--border-light);
}

.tonight-meals-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tonight-meal-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--bg);
    border-radius: 12px;
    color: inherit;
    transition: background 0.2s;
}

.tonight-meal-item:hover {
    background: var(--border-light);
}

.tonight-meal-link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.tonight-meal-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--border-light);
    flex-shrink: 0;
}

.tonight-meal-info {
    flex: 1;
    min-width: 0;
}

.tonight-meal-title {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tonight-meal-meta {
    font-size: 12px;
    color: var(--text-light);
}

.tonight-meal-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-dark);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}

.tonight-meal-remove:hover {
    background: rgba(239, 68, 68, 0.18);
}

.tonight-meal-remove:active {
    transform: scale(0.94);
}

.tonight-meal-remove svg {
    width: 16px;
    height: 16px;
}

.week-meal-image {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--border-light);
    flex-shrink: 0;
}

.week-meal-info {
    flex: 1;
    min-width: 0;
}

.week-meal-title {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.week-meal-meta {
    font-size: 12px;
    color: var(--text-light);
}

/* ============================================
   9. ADD RECIPE COMPONENTS
   ============================================ */

.add-wrapper {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding-top: 8px;
    padding-bottom: 120px;
}

.add-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.add-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.results-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.results-page-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.results-page-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.add-subtitle {
    font-size: 15px;
    color: var(--text-light);
}

.add-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.add-option-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    text-align: left;
    box-shadow: var(--shadow);
    color: var(--text);
}

.add-option-card:active {
    transform: translateY(1px);
}

.add-option-card.active {
    border: 2px solid rgba(245, 159, 63, 0.45);
    box-shadow: var(--shadow-lg);
}

.add-option-card--url {
    gap: 20px;
}

.add-option-card--photo {
    gap: 20px;
}

.add-option-card--paste {
    gap: 20px;
}

.add-option-header {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.add-option-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.add-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(245, 159, 63, 0.12);
    color: var(--primary);
}

.add-option-icon svg {
    width: 22px;
    height: 22px;
}

.add-option-title {
    font-size: 17px;
    font-weight: 700;
}

.add-option-text {
    font-size: 14px;
    color: var(--text-light);
}

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

.add-form-inline {
    gap: 12px;
    width: 100%;
}

.add-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface-alt);
    border-radius: 18px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.add-input-icon {
    display: flex;
    align-items: center;
    color: var(--text-light);
}

.add-input-group input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text);
}

.add-form-inline .primary-btn {
    padding: 14px;
    font-size: 16px;
}

.add-input-group input:focus {
    outline: none;
}

.add-form textarea {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    font-size: 15px;
    color: var(--text);
    min-height: 160px;
}

.add-form textarea:focus {
    outline: none;
    border-color: rgba(245, 159, 63, 0.45);
}

.add-form input[type="file"] {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px dashed rgba(245, 159, 63, 0.45);
    background: rgba(245, 159, 63, 0.08);
    color: var(--text);
    font-size: 14px;
}

.add-form input[type="file"]:focus {
    outline: none;
    border-color: var(--primary);
}

.see-all-btn {
    background: transparent;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
}

.recommended-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.recommended-card {
    position: relative;
    border-radius: 24px;
    color: rgba(255, 255, 255, 0.85);
    overflow: hidden;
    min-height: 190px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

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

.recommended-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(245, 159, 63, 0.35), rgba(217, 119, 6, 0.6));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: 700;
}

.recommended-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 35%, rgba(34, 40, 49, 0.65) 100%);
    color: white;
}

.recommended-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recommended-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
}

.recommended-like {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
     align-items: center;
    justify-content: center;
    font-size: 16px;
}

.recommended-like.favorited {
    background: var(--accent-red);
    color: var(--white);
}

.recommended-like svg {
    fill: none;
}

.recommended-like.favorited svg {
    fill: currentColor;
    stroke: currentColor;
}

.recommended-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.recommended-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.recommended-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.recommended-info span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.85;
}

/* ============================================
   7. BROWSE/RESULTS PAGE COMPONENTS
   ============================================ */

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
    padding-top: 48px;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.subtitle {
    font-size: 16px;
    color: var(--text-light);
}

/* Input */
.input-wrapper {
    margin-bottom: 16px;
}

textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    resize: none;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================================
   11. SHARED COMPONENTS (BUTTONS, CARDS, MODALS)
   ============================================ */

/* Buttons */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.primary-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    font-size: 18px;
    font-weight: 600;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.primary-btn:active {
    transform: scale(0.98);
    background: var(--primary-dark);
}

.secondary-btn {
    padding: 12px 20px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.icon-btn {
    background: none;
    color: var(--primary);
    font-size: 16px;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.icon {
    display: flex;
    align-items: center;
}

.icon svg,
.search-icon svg,
.toolbar-icon svg,
.category-icon svg,
.recommended-badge svg,
.recommended-like svg,
.recommended-info svg,
.meal-card-like svg,
.meal-card-why svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.2px;
}

.search-icon svg {
    width: 20px;
    height: 20px;
}

.toolbar-icon svg {
    width: 22px;
    height: 22px;
}

.category-icon svg {
    width: 24px;
    height: 24px;
}

.recommended-badge svg {
    width: 16px;
    height: 16px;
}

.meal-card-why svg {
    width: 16px;
    height: 16px;
    margin-right: 6px;
}

/* Browse Section */
.browse-section {
    margin-top: 48px;
    text-align: center;
}

.text-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 16px;
}

/* Results */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-top: 24px;
}

.results-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}


.results-search-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 14px 14px;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(15, 24, 54, 0.08);
}

.results-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.results-search-input::placeholder {
    color: var(--text-light);
}

.results-search-btn {
    border: none;
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background 0.2s ease;
}

.results-search-btn:hover {
    background: var(--primary-dark);
}

.results-search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.results-filter-group {
    flex: 1 1 140px;
}

.results-filter-input {
    width: 100%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
    font-size: 13px;
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    outline: none;
    transition: background 0.2s ease;
}

.results-filter-input::placeholder {
    color: var(--text-light);
}

.results-filter-input:focus {
    background: rgba(255, 255, 255, 0.18);
}

.context-banner {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Meal Cards */
.meals-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.meal-card-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.18);
    color: var(--white);
    font-size: 13px;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.meal-card-link-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.meal-card-link-btn i {
    width: 16px;
    height: 16px;
}

.meal-card {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    min-height: 220px;
    cursor: pointer;
    box-shadow: var(--shadow);
    background: var(--surface);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.meal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.meal-card-badge {
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.18);
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.meal-card-description {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin: 6px 0 0;
}

.meal-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.meal-card-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
}

.meal-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-lg);
}

.meal-card-image,
.meal-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.meal-card-image {
    position: absolute;
    inset: 0;
}

.meal-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    background: linear-gradient(135deg, rgba(245, 159, 63, 0.6), rgba(217, 119, 6, 0.85));
}

.meal-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.75) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 18px 16px;
}

.meal-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding-bottom: 12px;
}

.meal-card-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.meal-card-bottom {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.meal-card-why {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    line-height: 1.4;
    opacity: 0.95;
    font-weight: 600;
}

.meal-card-like {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.85);
}

.meal-card-like.favorited {
    background: var(--accent-red);
    color: var(--white);
}

.meal-card-like svg {
    fill: none;
}

.meal-card-like.favorited svg {
    fill: currentColor;
    stroke: currentColor;
}

.meal-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meal-card-tonight {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.85);
}

.meal-card-tonight.active {
    background: var(--primary);
    color: var(--white);
}

.meal-card-tonight svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.2px;
    fill: none;
}

.meal-card-tonight.active svg {
    fill: currentColor;
    stroke: currentColor;
}

/* ============================================
   8. RECIPE DETAIL COMPONENTS
   ============================================ */

.recipe-detail {
    padding-bottom: 80px;
}

.recipe-hero {
    margin: -24px -24px 0;
    position: relative;
}

.recipe-hero-figure {
    position: relative;
    overflow: hidden;
    border-radius: 0 0 36px 36px;
    height: clamp(260px, 45vh, 420px);
    background: linear-gradient(135deg, rgba(245, 159, 63, 0.25), rgba(217, 119, 6, 0.4));
    box-shadow: var(--shadow-lg);
}

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

.recipe-hero-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 54px;
    color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.55), rgba(217, 119, 6, 0.6));
}

.recipe-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px;
    pointer-events: none;
}

.recipe-hero-btn {
    width: 46px;
    height: 46px;
    border-radius: 18px;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
    pointer-events: all;
}

.recipe-hero-btn svg {
    width: 20px;
    height: 20px;
}

.recipe-hero-btn:active {
    transform: scale(0.94);
}

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

/* Image Edit Modal */
.image-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-edit-modal.hidden {
    display: none;
}

.image-edit-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.image-edit-modal-content {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 360px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

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

.image-edit-modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.image-edit-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--surface-alt);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-light);
    transition: background 0.2s ease, color 0.2s ease;
}

.image-edit-modal-close:hover {
    background: var(--border);
    color: var(--text);
}

.image-edit-modal-close svg {
    width: 20px;
    height: 20px;
}

.image-edit-modal-body {
    display: flex;
    flex-direction: column;
}

.image-edit-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    background: var(--surface-alt);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    transition: background 0.2s ease;
}

.image-edit-option:hover {
    background: var(--border);
}

.image-edit-option svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.image-edit-delete {
    color: var(--danger);
}

.image-edit-delete svg {
    color: var(--danger);
}

.image-edit-delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

.image-edit-divider {
    text-align: center;
    color: var(--text-muted);
    padding: 12px 0;
    font-size: 14px;
}

.image-edit-url-group {
    display: flex;
    gap: 8px;
}

.image-edit-url-input {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-alt);
    font-size: 15px;
    color: var(--text);
}

.image-edit-url-input:focus {
    outline: none;
    border-color: var(--primary);
}

.image-edit-url-btn {
    padding: 14px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.image-edit-url-btn:hover {
    background: var(--primary-dark);
}

.image-edit-file-input {
    display: none;
}

/* ============================================
   10. GROCERY LIST COMPONENTS
   ============================================ */

.groceries-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-top: 8px;
    padding-bottom: 120px;
}

.groceries-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.groceries-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.grocery-count {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-light);
}

.groceries-subtitle {
    color: var(--text-light);
    font-size: 15px;
}

.grocery-form {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.grocery-inputs {
    display: grid;
    grid-template-columns: minmax(120px, 160px) 1fr auto;
    gap: 12px;
    align-items: center;
}

.grocery-inputs input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px 14px;
    background: var(--surface-alt);
    font-size: 15px;
    color: var(--text);
}

.grocery-item-autocomplete {
    position: relative;
}

.grocery-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    max-height: 260px;
    overflow-y: auto;
    z-index: var(--z-dropdown);
}

.grocery-suggestion {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: none;
    text-align: left;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    cursor: pointer;
}

.grocery-suggestion:hover,
.grocery-suggestion:focus,
.grocery-suggestion.active {
    background: rgba(245, 159, 63, 0.1);
    outline: none;
}

.grocery-suggestion-name {
    font-weight: 600;
}

.grocery-suggestion-meta {
    font-size: 13px;
    color: var(--text-light);
}

.grocery-inputs input:focus {
    outline: none;
    border-color: rgba(245, 159, 63, 0.45);
}

.grocery-add-btn {
    white-space: nowrap;
    padding: 12px 18px;
}

.grocery-controls {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    font-size: 14px;
}

.grocery-controls-right {
    display: flex;
    gap: 16px;
    align-items: center;
}

.text-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-weight: 600;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.text-btn:active {
    transform: translateY(1px);
}

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

.text-btn-danger {
    color: var(--danger);
}

.text-btn-danger:hover {
    color: var(--danger-dark);
}

#grocery-toggle-checked {
    flex-shrink: 0;
}

.grocery-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(26, 43, 73, 0.08);
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.grocery-toggle-btn:hover {
    background: rgba(26, 43, 73, 0.14);
    color: var(--text);
}

.grocery-toggle-btn:active {
    transform: translateY(1px);
}

.grocery-toggle-btn.active {
    background: rgba(245, 159, 63, 0.18);
    color: var(--primary);
}

.grocery-toggle-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.2px;
}

.grocery-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.grocery-category {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.grocery-category-header {
    background: rgba(26, 43, 73, 0.08);
    color: var(--text-dark);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 12px;
}

.grocery-category-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.grocery-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.92);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    transition: opacity 0.2s ease;
}

.grocery-item.checked {
    opacity: 0.6;
}

.grocery-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 48px 20px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.grocery-loading p {
    margin: 0;
    color: var(--text-medium);
    font-size: 14px;
    font-weight: 500;
}

.grocery-item-content {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
}

.grocery-item-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 8px;
}

/* Drag handle for reordering */
.grocery-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    color: var(--text-muted);
    cursor: grab;
    touch-action: none;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.grocery-item:hover .grocery-drag-handle {
    opacity: 1;
}

.grocery-drag-handle:active {
    cursor: grabbing;
}

.grocery-drag-handle svg {
    width: 18px;
    height: 18px;
}

/* On touch devices, always show drag handle */
@media (hover: none) {
    .grocery-drag-handle {
        opacity: 0.7;
    }
}

/* SortableJS drag states for grocery items */
.grocery-item-ghost {
    opacity: 0.4;
    background: var(--primary-light);
}

.grocery-item-chosen {
    background: var(--surface);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: var(--radius);
}

.grocery-item-drag {
    opacity: 1;
}

.grocery-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.grocery-item-name {
    color: var(--text);
    font-weight: 500;
}

.grocery-item-quantity {
    font-size: 13px;
    font-weight: 400;
}

.grocery-item.checked .grocery-item-name {
    text-decoration: line-through;
}

.grocery-item-meta {
    font-size: 13px;
    color: var(--text-light);
}

.grocery-item-edit {
    border: none;
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.grocery-item-edit:hover {
    background: rgba(99, 102, 241, 0.18);
}

.grocery-item-edit:active {
    transform: scale(0.94);
}

/* Grocery Edit Modal Form */
.grocery-edit-modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.grocery-edit-modal-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.grocery-edit-modal-form .form-row {
    display: flex;
    gap: 12px;
}

.grocery-edit-modal-form .form-group-qty {
    flex: 0 0 90px;
}

.grocery-edit-modal-form .form-group-category {
    flex: 1;
}

.grocery-edit-modal-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.grocery-edit-modal-form .form-input {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    background: var(--surface);
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
}

/* Custom Select Dropdown */
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    min-height: 48px;
    box-sizing: border-box;
}

.custom-select-trigger:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.custom-select-trigger svg {
    flex-shrink: 0;
    color: var(--text-light);
    transition: transform 0.2s ease;
}

.custom-select.open .custom-select-trigger svg {
    transform: rotate(180deg);
}

.custom-select-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-options {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin: 0 0 4px 0;
    padding: 8px 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    list-style: none;
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.custom-select.open .custom-select-options {
    display: block;
}

.custom-select-options li {
    padding: 12px 16px;
    font-size: 16px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s ease;
}

.custom-select-options li:hover {
    background: var(--bg);
}

.custom-select-options li.selected {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

.custom-select-options li:focus {
    outline: none;
    background: var(--bg);
}

.grocery-edit-modal-form .form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.grocery-edit-modal-form .modal-actions {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

@media (max-width: 400px) {
    .grocery-edit-modal-form .form-row {
        flex-direction: column;
    }

    .grocery-edit-modal-form .form-group-qty {
        flex: 1;
    }
}

/* Camera Buttons Container */
.grocery-camera-btns {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.grocery-camera-btns .primary-btn {
    padding: 8px 10px;
    min-width: auto;
}

.grocery-camera-btns svg {
    width: 16px;
    height: 16px;
}

/* Button labels visible on all screen sizes */
.grocery-camera-btns .primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.grocery-camera-btns .btn-label {
    font-size: 14px;
}

/* Barcode Scanner Modal */
.scanner-modal-content {
    width: 90vw;
    max-width: 400px;
}

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

.scanner-header .modal-title {
    margin: 0;
}

.scanner-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-light);
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.scanner-close-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.scanner-close-btn svg {
    width: 20px;
    height: 20px;
}

#barcode-reader {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

#barcode-reader video {
    width: 100%;
    border-radius: 8px;
}

.scanner-hint {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 12px;
    font-size: 14px;
}

/* Hide html5-qrcode default UI elements we don't need */
#barcode-reader__scan_region img {
    display: none;
}

#barcode-reader__dashboard_section_csr button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin: 8px auto;
}

#barcode-reader__dashboard_section_swaplink {
    display: none;
}

/* Photo Capture Modal */
#photo-preview-container {
    width: 100%;
    aspect-ratio: 4/3;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

#photo-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#photo-canvas {
    display: none;
}

#photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

#photo-preview.hidden {
    display: none;
}

.photo-controls {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.photo-controls .primary-btn,
.photo-controls .secondary-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
}

.photo-controls .secondary-btn {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.photo-controls .secondary-btn:hover {
    background: var(--surface-hover);
}

.photo-controls .hidden {
    display: none;
}

.grocery-empty {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 2px dashed rgba(245, 159, 63, 0.25);
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.grocery-empty svg {
    width: 48px;
    height: 48px;
    stroke-width: 1.5;
}

/* Small Mobile Adjustments (540px and below) */
@media (max-width: 540px) {
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .results-search-form,
    .results-search-filters,
    .results-search-row {
        width: 100%;
    }

    .results-filter-group {
        flex: 1 1 100%;
    }

    .grocery-inputs {
        grid-template-columns: 1fr;
    }

    .grocery-add-btn {
        width: 100%;
    }

    .grocery-controls {
        gap: 12px;
    }

    .grocery-controls-right {
        gap: 12px;
    }

    .grocery-controls .text-btn {
        font-size: 13px;
        white-space: nowrap;
    }

    .grocery-item {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
}

.hero-back {
    background: rgba(255, 255, 255, 0.82);
}

.hero-delete {
    background: rgba(255, 255, 255, 0.82);
}

.hero-delete:hover {
    color: var(--danger-darker);
}

.hero-favorite {
    background: rgba(255, 255, 255, 0.94);
    color: var(--text);
}

.hero-favorite.favorited {
    background: var(--accent-red);
    color: var(--white);
}

.hero-favorite.favorited svg {
    fill: currentColor;
    stroke: currentColor;
}

.hero-tonight {
    background: rgba(255, 255, 255, 0.94);
    color: var(--text);
}

.hero-tonight.active {
    background: var(--primary);
    color: var(--white);
}

.hero-tonight.active svg {
    fill: currentColor;
    stroke: currentColor;
}

.recipe-info-card {
    position: relative;
    margin: -56px auto 0;
    background: var(--surface);
    border-radius: 32px;
    padding: 28px 24px 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 520px;
}

.recipe-info-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
}

.recipe-info-subtitle {
    text-align: center;
    font-size: 15px;
    color: var(--text-light);
}

.recipe-stats {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.recipe-stat {
    flex: 1 1 30%;
    min-width: 110px;
    background: var(--surface-alt);
    border-radius: 18px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    color: var(--text);
    font-weight: 600;
    text-align: center;
}

.recipe-stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(245, 159, 63, 0.15);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.recipe-stat-icon svg {
    width: 16px;
    height: 16px;
}

.recipe-stat-label {
    font-size: 14px;
    font-weight: 600;
}

.recipe-body {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin: 36px auto 0;
    max-width: 560px;
}

.recipe-image-tools {
    margin-bottom: 8px;
}

.generate-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
}

.image-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 400px;
}

.generate-image-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-blue) 100%);
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.generate-image-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.generate-image-btn:active {
    transform: translateY(0);
}

.generate-image-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.generate-image-btn svg {
    width: 18px;
    height: 18px;
}

.upload-image-group {
    width: 100%;
}

.upload-image-input {
    display: none;
}

.upload-image-btn {
    background: var(--surface);
    color: var(--primary);
    font-size: 16px;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: var(--radius);
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.upload-image-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.upload-image-btn:active {
    transform: translateY(1px);
}

.upload-image-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.upload-image-btn svg {
    width: 18px;
    height: 18px;
}

.custom-image-divider {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    width: 100%;
    text-align: center;
}

.custom-image-divider::before,
.custom-image-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}

.custom-image-divider::before {
    left: 0;
}

.custom-image-divider::after {
    right: 0;
}

.custom-image-input-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.custom-image-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.custom-image-input:focus {
    outline: none;
    border-color: var(--primary);
}

.set-image-btn {
    background: var(--surface);
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 20px;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.set-image-btn:hover {
    background: var(--primary);
    color: white;
}

.set-image-btn:active {
    transform: scale(0.98);
}

/* File Upload Styles */
.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.file-drop-zone {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 18px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface-alt);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.file-drop-zone:hover,
.file-drop-zone:focus-visible {
    border-color: rgba(245, 159, 63, 0.6);
    background: rgba(245, 159, 63, 0.08);
    box-shadow: 0 8px 24px rgba(200, 176, 145, 0.16);
    outline: none;
}

.file-drop-zone.dragover {
    border-color: rgba(245, 159, 63, 0.6);
    background: rgba(245, 159, 63, 0.08);
    box-shadow: 0 12px 30px rgba(200, 176, 145, 0.22);
}

.file-drop-zone.has-file {
    border-color: rgba(245, 159, 63, 0.9);
    background: rgba(245, 159, 63, 0.12);
}

.file-drop-zone-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(245, 159, 63, 0.15);
    color: var(--primary);
}

.file-drop-zone-icon svg {
    width: 26px;
    height: 26px;
}

.file-drop-zone-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.file-drop-zone-title {
    font-size: 16px;
    font-weight: 600;
}

.file-drop-zone-hint {
    font-size: 13px;
    color: var(--text-light);
}

.file-help-text {
    font-size: 13px;
    color: var(--text-light);
}

/* Multi-page photo upload */
.photo-previews {
    display: flex;
    gap: 12px;
    width: 100%;
}

.photo-previews .file-drop-zone {
    flex: 1;
    min-height: 120px;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 16px;
}

.photo-previews .file-drop-zone.has-file {
    padding: 12px;
}

.photo-previews .file-drop-zone-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
}

.photo-previews .file-drop-zone-icon svg {
    width: 24px;
    height: 24px;
}

.photo-previews .file-drop-zone-text {
    font-size: 13px;
    color: var(--text-light);
}

.dropzone-thumbnail {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
    border-radius: 4px;
}

.dropzone-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    margin-top: 6px;
}

.dropzone-remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--danger, #e74c3c);
    color: white;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.dropzone-remove-btn:hover {
    opacity: 1;
}

.add-second-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 16px;
    margin-top: 8px;
    font-size: 14px;
}

.add-second-page-btn svg {
    width: 16px;
    height: 16px;
}

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

.recipe-section-danger {
    border-top: 1px solid rgba(239, 68, 68, 0.15);
    padding-top: 24px;
}

.recipe-section-danger h3 {
    color: var(--danger-dark);
}

.danger-zone-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: var(--danger-darker);
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.danger-zone-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.8);
    color: var(--danger-darkest);
}

.danger-zone-btn:active {
    transform: translateY(1px);
}

.recipe-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.recipe-description {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.recipe-keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.recipe-keyword-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    background: rgba(245, 159, 63, 0.12);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.recipe-source-link {
    display: inline-block;
    font-size: 14px;
    color: var(--primary-dark);
    text-decoration: none;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    word-break: break-all;
}

.recipe-source-link:hover {
    background: rgba(245, 159, 63, 0.08);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.recipe-source-link:active {
    transform: translateY(0);
}

.recipe-source-text {
    font-size: 14px;
    color: var(--text);
    padding: 12px 16px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.ingredient-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.ingredient-select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text);
}

.ingredient-select-all input {
    width: 18px;
    height: 18px;
}

.ingredient-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.ingredient-add-btn:hover:not(:disabled) {
    background: var(--primary-dark);
}

.ingredient-add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ingredient-add-btn[aria-busy="true"] {
    opacity: 0.75;
    pointer-events: none;
}

.ingredient-add-btn-icon {
    display: inline-flex;
    align-items: center;
}

.ingredient-add-btn-label {
    font-weight: 600;
}

.ingredient-add-btn-loading {
    display: none;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.ingredient-add-btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ingredient-add-spin 0.8s linear infinite;
}

.ingredient-add-btn[aria-busy="true"] .ingredient-add-btn-icon,
.ingredient-add-btn[aria-busy="true"] .ingredient-add-btn-label {
    display: none;
}

.ingredient-add-btn[aria-busy="true"] .ingredient-add-btn-loading {
    display: inline-flex;
}

@keyframes ingredient-add-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.ingredient-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--border);
}

.ingredient-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.ingredient-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.ingredient-select {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.ingredient-name {
    color: var(--text);
}

.ingredient-amount {
    color: var(--text-light);
    font-weight: 500;
}

/* Step container wraps both step and ingredients */
.step-container {
    margin-bottom: 12px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.step-container:hover {
    border-color: rgba(245, 159, 63, 0.2);
}

.step-container.active {
    border-color: var(--accent-orange);
    border-width: 3px;
    box-shadow: 0 4px 16px rgba(194, 65, 12, 0.5);
}

.step-item {
    padding: 16px;
    background: var(--bg);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.step-container:hover .step-item {
    background: rgba(245, 159, 63, 0.08);
}

.step-container.active .step-item {
    background: rgba(245, 159, 63, 0.25);
}

.step-number {
    display: inline-block;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-weight: 600;
    font-size: 14px;
}

.step-text {
    flex: 1;
    line-height: 1.6;
}

.step-time {
    flex-shrink: 0;
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-light, #e3f2fd);
    color: var(--primary);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Step Header Layout */
.step-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

/* Step Ingredients Section */
.step-ingredients-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: white;
    overflow: hidden;
    cursor: default;
}

.step-ingredient-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
}

.step-ingredient-item:last-child {
    border-bottom: none;
}

.step-ingredient-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    cursor: pointer;
}

.step-ingredient-check {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.step-ingredient-name {
    color: var(--text);
    font-size: 14px;
}

.step-ingredient-amount {
    color: var(--text-light);
    font-weight: 400;
    font-size: 14px;
    margin-left: auto;
}

/* Mobile Toolbar (Navigation) */
.mobile-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 24px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
    z-index: var(--z-toolbar);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.toolbar-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 0;
    background: none;
    border-radius: 12px;
    color: var(--text-light);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-decoration: none;
}

.toolbar-btn.active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.12);
}

.toolbar-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.toolbar-label {
    pointer-events: none;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toolbar-icon {
    display: flex;
    align-items: center;
    line-height: 1;
}

/* Loading Overlay */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loading);
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.loading p {
    color: var(--text-light);
    font-size: 16px;
}

/* Favorite Button */
.browse-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

/* Fixed Bottom Action Bar (for future use) */
.action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 16px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   LANDING PAGE STYLES
   ============================================ */

.page-landing {
    background: var(--bg);
    display: block;
    width: 100%;
}

/* Don't use container divs on landing page - sections are full width */
.page-landing .container {
    max-width: none;
    min-height: auto;
    background: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

/* Ensure sections stack vertically */
.landing-hero,
.landing-features,
.landing-how-it-works,
.landing-cta,
.landing-footer {
    width: 100%;
    display: block;
    clear: both;
    overflow-x: hidden;
}

/* Navigation */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--surface);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.landing-nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-family: 'Nunito', sans-serif;
    font-size: 24px;
    color: var(--text);
}

.landing-nav-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.landing-nav-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.landing-nav-actions .btn-primary,
.landing-nav-actions .btn-secondary {
    padding: 10px 20px;
    font-size: 14px;
}

/* Hero Section */
.landing-hero {
    padding: 120px 24px 80px;
    text-align: center;
    width: 100%;
    background-image: url('/images/hero-background.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Hero layout container */
.hero-layout {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: 100%;
    max-width: 1200px;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Dark overlay for text readability */
.landing-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* Ensure content is above overlay */
.landing-hero h1,
.landing-hero .hero-subtitle,
.landing-hero .btn-large {
    position: relative;
    z-index: 2;
}

.landing-hero h1 {
    font-size: 40px;
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
    line-height: 1.2;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.landing-hero .hero-subtitle {
    font-size: 22px;
    color: white;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
}

/* Button styles for landing page */
.btn-primary {
    display: inline-block;
    padding: 14px 28px;
    background: var(--primary);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(245, 159, 63, 0.3);
}

.btn-primary:hover {
    background: #e88f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 159, 63, 0.4);
}

.btn-secondary {
    display: inline-block;
    padding: 14px 28px;
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius);
    text-decoration: none;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Large button variant */
.btn-primary.btn-large,
.btn-secondary.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

/* Features Section */
.landing-features {
    padding: 60px 24px;
    background: var(--surface);
    width: 100%;
}

.landing-features h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 48px;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.feature-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    border: 1px solid var(--border);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.feature-icon svg {
    width: 32px;
    height: 32px;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.6;
}

/* How It Works */
.landing-how-it-works {
    padding: 60px 24px;
    background: var(--bg);
    width: 100%;
}

.landing-how-it-works h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 48px;
}

.process-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.process-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

.process-step h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.process-step p {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.6;
}

/* CTA Section */
.landing-cta {
    padding: 80px 24px;
    text-align: center;
    background: var(--surface);
    width: 100%;
}

.landing-cta h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 32px;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Footer */
.landing-footer {
    background: var(--text);
    color: white;
    padding: 32px 24px;
    text-align: center;
    width: 100%;
}

.landing-footer p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}

/* Hero Video Container */
.hero-video-container {
    position: relative;
    z-index: 2;
    margin: 32px auto;
    max-width: 600px;
    width: 100%;
    padding: 0 16px;
}

/* Video Placeholder (for all sections) */
.video-placeholder {
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-lg);
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-placeholder:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
}

.video-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: white;
    opacity: 0.9;
}

.video-placeholder-content svg {
    width: 48px;
    height: 48px;
}

.video-placeholder-content span {
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   PHONE MOCKUP STYLES
   ============================================ */

/* Phone Frame Container */
.phone-mockup {
    position: relative;
    display: inline-block;
    max-width: 280px;
    width: 100%;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.phone-mockup:hover {
    transform: translateY(-8px);
}

/* The phone frame itself */
.phone-mockup-frame {
    position: relative;
    background: #1a1a1a;
    border-radius: 44px;
    padding: 12px;
    box-shadow:
        0 0 0 2px #333,
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        inset 0 0 3px rgba(255, 255, 255, 0.1);
    transition: box-shadow 0.3s ease;
}

.phone-mockup:hover .phone-mockup-frame {
    box-shadow:
        0 0 0 2px #333,
        0 35px 60px -15px rgba(0, 0, 0, 0.5),
        inset 0 0 3px rgba(255, 255, 255, 0.1);
}

/* Dynamic Island / Notch - hidden by default */
.phone-mockup-notch {
    display: none;
}

/* Screen area with rounded corners */
.phone-mockup-screen {
    position: relative;
    background: var(--surface);
    border-radius: 32px;
    overflow: hidden;
    aspect-ratio: 9 / 19.5;
    padding: 8px;
}

/* The actual screenshot image */
.phone-mockup-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    border-radius: 24px;
}

/* Hero phone container */
.hero-phone-container {
    position: relative;
    z-index: 2;
    margin: 32px auto;
    display: flex;
    justify-content: center;
    padding: 0 16px;
}

/* Hero carousel for rotating screenshots */
.hero-carousel {
    position: relative;
}

.hero-carousel .carousel-img {
    position: absolute;
    top: 8px;
    left: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    object-fit: cover;
    object-position: top center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

/* First image stays in flow to maintain container height */
.hero-carousel .carousel-img:first-child {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-carousel .carousel-img.active {
    opacity: 1;
}

/* White glow effect for hero on dark background */
.landing-hero .phone-mockup-frame {
    box-shadow:
        0 0 0 2px #333,
        0 0 60px rgba(255, 255, 255, 0.1),
        0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.landing-hero .phone-mockup:hover .phone-mockup-frame {
    box-shadow:
        0 0 0 2px #333,
        0 0 80px rgba(255, 255, 255, 0.15),
        0 35px 60px -15px rgba(0, 0, 0, 0.6);
}

/* Feature section phone mockups (smaller) */
.feature-phone-mockup {
    position: relative;
    max-width: 220px;
    width: 100%;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.feature-phone-mockup:hover {
    transform: translateY(-4px);
}

.feature-phone-mockup .phone-mockup-frame {
    border-radius: 36px;
    padding: 10px;
}

.feature-phone-mockup .phone-mockup-screen {
    border-radius: 26px;
    aspect-ratio: 9 / 19.5;
}

/* Dual screenshot layout */
.feature-screenshot-dual {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    justify-items: center;
}

/* Scroll animation for feature phone mockups */
@keyframes phoneSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-phone-mockup {
    opacity: 0;
}

.feature-phone-mockup.animate-in {
    animation: phoneSlideUp 0.6s ease-out forwards;
}

/* Staggered animation for dual screenshots */
.feature-screenshot-dual .feature-phone-mockup:nth-child(2).animate-in {
    animation-delay: 0.15s;
}

/* Hero CTA Group */
.hero-cta-group {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Problem/Solution Section */
.landing-problem-solution {
    padding: 80px 24px;
    background: var(--surface);
    width: 100%;
}

.landing-problem-solution .section-content {
    max-width: 1000px;
    margin: 0 auto;
}

.landing-problem-solution h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 48px;
}

.problem-solution-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.problem-column,
.solution-column {
    padding: 24px;
    border-radius: var(--radius-lg);
}

.problem-column {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.solution-column {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.column-label {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.problem-column .column-label {
    color: #dc2626;
}

.solution-column .column-label {
    color: #16a34a;
}

.problem-list,
.solution-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.problem-list li,
.solution-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
}

.problem-list svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #dc2626;
    margin-top: 2px;
}

.solution-list svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #16a34a;
    margin-top: 2px;
}

/* Feature Showcase (new alternating layout) */
.feature-showcase {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 64px;
}

.feature-block {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: center;
}

.feature-content {
    padding: 0 16px;
}

.feature-icon-badge {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.feature-icon-badge svg {
    width: 28px;
    height: 28px;
    color: white;
}

.feature-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

.feature-details {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-details li {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-light);
}

.feature-details strong {
    color: var(--text);
}

.feature-visual {
    padding: 0 16px;
}

.feature-visual .video-placeholder {
    background: var(--bg);
    border-color: var(--border);
}

.feature-visual .video-placeholder-content {
    color: var(--text-light);
}

/* Trust Section */
.landing-trust {
    padding: 80px 24px;
    background: var(--bg);
    width: 100%;
}

.landing-trust .section-content {
    max-width: 1000px;
    margin: 0 auto;
}

.landing-trust h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.section-subtitle {
    text-align: center;
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 48px;
}

.trust-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.trust-item {
    text-align: center;
    padding: 24px;
}

.trust-icon {
    width: 56px;
    height: 56px;
    background: rgba(245, 159, 63, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.trust-icon svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.trust-item h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.trust-item p {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.5;
}

/* Use Cases Section */
.landing-use-cases {
    padding: 80px 24px;
    background: var(--surface);
    width: 100%;
}

.landing-use-cases h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.landing-use-cases .section-subtitle {
    margin-bottom: 48px;
}

.use-cases-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.use-case-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
}

.use-case-scenario {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
}

.use-case-scenario svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.use-case-solution {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-light);
    font-size: 15px;
    padding-left: 32px;
}

.use-case-solution svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--primary);
}

/* CTA Subtitle */
.cta-subtitle {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 32px;
    text-align: center;
}

/* Tablet (768px+) */
@media (min-width: 768px) {
    .landing-hero h1 {
        font-size: 56px;
    }

    .phone-mockup {
        max-width: 320px;
    }

    .feature-phone-mockup {
        max-width: 240px;
    }

    .feature-screenshot-dual {
        grid-template-columns: repeat(2, 1fr);
    }

    .problem-solution-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .feature-block {
        grid-template-columns: repeat(2, 1fr);
    }

    .feature-block.feature-right .feature-visual {
        order: -1;
    }

    .trust-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .use-cases-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .process-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .landing-hero {
        padding: 160px 48px 100px;
    }

    .hero-layout {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 48px;
    }

    .hero-content {
        flex: 1;
        align-items: center;
        text-align: center;
    }

    .hero-cta-group {
        justify-content: center;
        width: 100%;
    }

    .hero-phone-container {
        flex-shrink: 0;
        margin: 0;
    }

    .landing-hero h1 {
        font-size: 56px;
    }

    .hero-video-container {
        max-width: 700px;
    }

    .phone-mockup {
        max-width: 320px;
    }

    .feature-phone-mockup {
        max-width: 260px;
    }

    .landing-problem-solution,
    .landing-trust,
    .landing-use-cases {
        padding-left: 48px;
        padding-right: 48px;
    }

    .trust-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 900px;
        margin: 0 auto;
    }

    .process-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 32px;
    }

    .landing-features,
    .landing-how-it-works,
    .landing-cta {
        padding-left: 48px;
        padding-right: 48px;
    }
}

/* ============================================
   AUTH PAGES (Login, Register, Password Reset)
   ============================================ */

.page-auth {
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    padding-top: 40px;
}

.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

.auth-logo img {
    width: 80px;
    height: 80px;
    margin-bottom: -8px;
}

.auth-logo-text {
    font-family: 'Nunito', sans-serif;
    font-size: 32px;
    color: var(--text);
}

.auth-logo {
    text-decoration: none;
}

.auth-card {
    background: var(--surface);
    padding: 32px 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 8px;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
}

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

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

.auth-form label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.auth-form input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 159, 63, 0.15);
}

.auth-form input::placeholder {
    color: var(--text-light);
}

.auth-form .form-help {
    font-size: 13px;
    color: var(--text-light);
}

.auth-form .form-link {
    text-align: right;
    margin-top: 4px;
}

.auth-form .form-link a {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-form .form-link a:hover {
    text-decoration: underline;
}

.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 8px;
}

.auth-submit-btn:hover {
    background: var(--primary-dark);
}

.auth-submit-btn:active {
    transform: scale(0.98);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-toggle {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-light);
}

.auth-toggle a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

.auth-back-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.auth-back-link a {
    color: var(--text-light);
    text-decoration: none;
}

.auth-back-link a:hover {
    color: var(--primary);
}

/* Auth Messages */
.auth-message {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.auth-message.info {
    background: rgba(245, 159, 63, 0.1);
    color: var(--primary-dark);
    border: 1px solid rgba(245, 159, 63, 0.3);
}

/* Auth Loading State */
.auth-loading {
    text-align: center;
    padding: 40px 20px;
}

.auth-loading .spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: auth-spin 1s linear infinite;
    margin: 0 auto 16px;
}

.auth-loading p {
    color: var(--text-light);
    font-size: 14px;
}

@keyframes auth-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Auth responsive */
@media (min-width: 480px) {
    .auth-card {
        padding: 40px 32px;
    }
}

/* ============================================
   12. MEDIA QUERIES (RESPONSIVE)
   ============================================ */

/* System User Warning Banner */
.system-user-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #dc2626 0%, #ef4444 50%, #dc2626 100%);
    color: white;
    padding: 10px 16px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    z-index: 99999;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.system-user-banner svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.system-user-banner-text {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Adjust body when system banner is visible */
body.has-system-banner {
    padding-top: 44px;
}

body.has-system-banner .desktop-nav {
    top: 44px;
}

body.has-system-banner .mobile-header {
    top: 44px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: calc(var(--toolbar-height) + 20px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--neutral-dark);
    color: var(--white);
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 15px;
    font-weight: 500;
    z-index: var(--z-toast);
    max-width: 90%;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.toast:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.toast.toast-success {
    background: var(--success-light);
}

.toast.toast-error {
    background: var(--danger);
}

.toast.toast-info {
    background: var(--accent-blue-light);
}

/* Confirmation Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-content-wide {
    max-width: 540px;
}

.modal-content-scroll {
    max-height: 85vh;
    overflow-y: auto;
}

.modal:not(.hidden) .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px 0;
}

.modal-message {
    font-size: 15px;
    color: var(--text-light);
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.modal-btn-secondary {
    background: var(--bg);
    color: var(--text);
}

.modal-btn-secondary:hover {
    background: var(--border-light);
}

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

.modal-btn-danger:hover {
    background: var(--danger-dark);
}

/* ============================================
   PLAN MODAL
   ============================================ */

.modal-content-plan {
    max-width: 360px;
}

.plan-days-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.plan-day-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 12px;
    text-align: left;
}

.plan-day-btn:hover {
    border-color: var(--primary);
    background: var(--primary-lightest, rgba(255, 107, 53, 0.05));
}

.plan-day-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.plan-day-btn.today {
    border-color: var(--accent, #10b981);
}

.plan-day-btn.today:not(.selected) {
    background: rgba(16, 185, 129, 0.05);
}

.plan-day-info {
    display: flex;
    flex-direction: column;
    min-width: 70px;
}

.plan-day-name {
    font-weight: 600;
    font-size: 14px;
}

.plan-day-date {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.plan-day-btn.selected .plan-day-date {
    color: rgba(255, 255, 255, 0.8);
}

.plan-day-meal {
    font-size: 13px;
    color: var(--text-muted);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

.plan-day-btn.selected .plan-day-meal {
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   EDIT RECIPE MODAL
   ============================================ */

.modal-edit .modal-content-edit {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
}

.edit-modal-header {
    position: sticky;
    top: 0;
    background: var(--surface);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.edit-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.edit-modal-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-light);
    border-radius: 8px;
}

.edit-modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

.edit-modal-body {
    padding: 24px;
}

/* Form sections */
.edit-section {
    margin-bottom: 24px;
}

.edit-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

/* Form fields */
.edit-field {
    margin-bottom: 16px;
}

.edit-field-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.edit-field-input,
.edit-field-textarea,
.edit-field-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 15px;
    color: var(--text);
    font-family: inherit;
    box-sizing: border-box;
}

.edit-field-input:focus,
.edit-field-textarea:focus,
.edit-field-select:focus {
    outline: none;
    border-color: var(--primary);
}

.edit-field-textarea {
    min-height: 80px;
    resize: none;
    overflow: hidden;
}

/* Inline field groups (e.g., time + difficulty) */
.edit-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Dynamic list (ingredients/steps) */
.edit-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.edit-list-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.edit-list-item-number {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 8px;
}

.edit-list-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Ingredient row specific */
.edit-ingredient-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 8px;
}

.edit-ingredient-name {
    grid-column: 1 / -1;
}

.edit-list-item-remove {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-light);
    border-radius: 6px;
    flex-shrink: 0;
    margin-top: 4px;
}

.edit-list-item-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.edit-list-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    background: transparent;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-list-add:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(245, 159, 63, 0.05);
}

.edit-list-add svg {
    width: 16px;
    height: 16px;
}

/* Step row specific */
.edit-step-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.edit-step-instruction {
    flex: 1;
    min-height: 60px;
    resize: none;
    overflow: hidden;
}

.edit-step-time {
    width: 80px;
    flex-shrink: 0;
}

.edit-step-time-label {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
    text-align: center;
}

/* Step ingredient selection */
.edit-step-ingredients {
    margin-top: 8px;
}

.edit-step-ingredients-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-light);
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: all 0.2s;
}

.edit-step-ingredients-toggle:hover {
    border-color: var(--primary);
    color: var(--text);
}

.edit-step-ingredients-toggle svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.edit-step-ingredients-arrow {
    margin-left: auto;
    transition: transform 0.2s;
}

.edit-step-ingredients-toggle[aria-expanded="true"] .edit-step-ingredients-arrow {
    transform: rotate(180deg);
}

.edit-step-ingredients-label {
    flex: 1;
}

.edit-step-ingredients-count {
    font-weight: 600;
    color: var(--primary);
}

.edit-step-ingredients-dropdown {
    margin-top: 8px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
}

.edit-step-ingredients-empty {
    font-size: 13px;
    color: var(--text-light);
    font-style: italic;
    padding: 8px;
    text-align: center;
    margin: 0;
}

.edit-step-ingredient-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}

.edit-step-ingredient-option:hover {
    background: var(--bg);
}

.edit-step-ingredient-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.edit-step-ingredient-option span {
    font-size: 14px;
    color: var(--text);
    line-height: 1.3;
}

.edit-step-ingredient-option:has(input:checked) {
    background: rgba(245, 159, 63, 0.1);
}

.edit-step-ingredient-option:has(input:checked) span {
    font-weight: 500;
}

/* Modal footer with actions */
.edit-modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--surface);
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.edit-btn-cancel {
    padding: 12px 24px;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
}

.edit-btn-cancel:hover {
    background: var(--border-light);
}

.edit-btn-save {
    padding: 12px 24px;
    background: var(--primary);
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
}

.edit-btn-save:hover {
    background: var(--primary-dark);
}

.edit-btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Hero edit button */
.hero-edit {
    background: rgba(255, 255, 255, 0.9);
}

.hero-edit:hover {
    background: white;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .modal-edit .modal-content-edit {
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .edit-field-row {
        grid-template-columns: 1fr;
    }

    .edit-ingredient-row {
        grid-template-columns: 1fr 1fr;
    }

    .edit-ingredient-name {
        grid-column: 1 / -1;
    }
}

/* Step Timer (floating above navigation) - matches cook-timer style */
.step-timer {
    position: fixed;
    bottom: calc(var(--toolbar-height) + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-timer);
    max-width: 500px;
    width: calc(100% - 48px);
}

.step-timer-content {
    background: var(--surface);
    border-radius: 20px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    border: 2px solid var(--primary);
}

.step-timer-recipe-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    text-align: center;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-timer-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.step-timer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.step-timer-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.step-timer-display {
    font-size: 48px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    min-width: 100px;
    text-align: center;
}

.step-timer-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
}

.step-timer-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 4px;
}

.step-timer-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(245, 159, 63, 0.3);
}

.step-timer-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.step-timer-btn:active {
    transform: scale(0.95);
}

.step-timer-btn svg {
    width: 18px;
    height: 18px;
}

.step-timer-btn-secondary {
    background: rgba(245, 159, 63, 0.15);
    color: var(--primary);
    box-shadow: none;
}

.step-timer-btn-secondary:hover {
    background: rgba(245, 159, 63, 0.25);
}

/* Timer Stop Button */
.step-timer-stop,
.cook-timer-stop {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    background: var(--text-light);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1;
}

.step-timer-stop:hover,
.cook-timer-stop:hover {
    background: var(--danger, #e74c3c);
    transform: scale(1.1);
}

.step-timer-stop:active,
.cook-timer-stop:active {
    transform: scale(0.95);
}

.step-timer-stop svg,
.cook-timer-stop svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 480px) {
    .step-timer-content {
        padding: 10px 14px;
    }

    .step-timer-label {
        font-size: 9px;
    }

    .step-timer-display {
        font-size: 39px;
        min-width: 90px;
    }

    .step-timer-group {
        gap: 12px;
    }

    .step-timer-btn {
        width: 36px;
        height: 36px;
    }

    .step-timer-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Tablet (768px and up) */
@media (min-width: 768px) {
    .container {
        box-shadow: var(--shadow-lg);
    }

    .section {
        padding: 32px 48px;
        padding-bottom: calc(32px + var(--toolbar-height));
    }

    .meal-card:hover {
        border-color: var(--primary);
        box-shadow: var(--shadow);
    }

    .toast {
        max-width: 400px;
    }

    .step-timer {
        width: auto;
        min-width: 420px;
    }

    .step-timer-display {
        font-size: 54px;
        min-width: 110px;
    }

    .step-timer-label {
        font-size: 11px;
    }

    /* Tablet: Expand container */
    .container {
        max-width: 900px;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    /* Typography Scale - Desktop */
    :root {
        --text-base: 1.0625rem;
        --text-lg: 1.25rem;
        --text-xl: 1.375rem;
        --text-2xl: 1.75rem;
        --text-3xl: 2.25rem;
    }

    /* Layout: Expand container and adjust for sidebar */
    .container {
        max-width: 1200px;
        padding-bottom: 24px; /* Remove toolbar padding on desktop */
        margin-left: 0;
        margin-right: 0;
    }

    body {
        display: flex;
    }

    /* Adjust container for sidebar */
    .container {
        margin-left: 240px;
        width: calc(100% - 240px);
    }

    /* Hide mobile toolbar on desktop */
    .mobile-toolbar {
        display: none;
    }

    /* Center step-timer relative to content area (account for 240px sidebar) */
    .step-timer {
        left: calc(50% + 120px);
    }

    /* Desktop Navigation Sidebar */
    .desktop-nav {
        display: flex;
        position: fixed;
        left: 0;
        top: 0;
        width: 240px;
        height: 100vh;
        flex-direction: column;
        padding: 32px 24px;
        background: var(--surface);
        border-right: 1px solid var(--border);
        z-index: var(--z-fixed);
        box-shadow: var(--shadow-sm);
    }

    .desktop-nav-logo {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0px;
        margin-bottom: 48px;
        text-decoration: none;
    }

    .desktop-nav-logo-image {
        width: 80px;
        height: 80px;
    }

    .desktop-nav-logo-text {
        font-family: 'Nunito', sans-serif;
        font-size: 28px;
        color: var(--text-dark);
        margin-top: -13px;
    }

    .desktop-nav-links {
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex: 1;
    }

    .desktop-nav-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        border-radius: var(--radius);
        color: var(--text);
        text-decoration: none;
        font-weight: 500;
        transition: all 0.2s ease;
    }

    .desktop-nav-link:hover {
        background: var(--surface-alt);
        color: var(--primary);
    }

    .desktop-nav-link.active {
        background: var(--primary);
        color: white;
    }

    .desktop-nav-link svg {
        width: 20px;
        height: 20px;
    }

    /* Desktop logout button - positioned at bottom of sidebar */
    .desktop-nav .logout-btn {
        margin-top: auto;
        margin-bottom: 32px;
        border: none;
        background: transparent;
        cursor: pointer;
        width: 100%;
        text-align: left;
        font-family: inherit;
    }

    .desktop-nav .logout-btn:hover {
        background: var(--surface-alt);
        color: var(--danger);
    }

    /* Section padding adjustments */
    .section {
        padding: 32px 48px;
        padding-bottom: 32px;
    }

    /* Home Page - Desktop Layout */
    .page-home .section {
        padding: 32px 0;
        padding-bottom: 32px;
    }

    .home-wrapper {
        padding: 48px 24px;
        max-width: none;
    }

    .home-search-card {
        max-width: 1100px;
        width: 100%;
        margin: 0 auto 48px;
    }

    .category-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }

    .recent-favorites-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    /* Browse Page - Multi-column Grid */
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    /* Recipe Detail - Keep stacked layout like mobile */
    .recipe-body {
        /* Stacked layout maintained on desktop */
        display: block;
    }

    /* Add Recipe Page - Expand like grocery items */
    .add-wrapper {
        max-width: none; /* Remove constraint - let it fill available space */
        margin: 0 auto;
    }

    .add-options {
        /* No max-width or margin - let cards expand to fill container like grocery-item */
        grid-template-columns: 1fr; /* Force single column on desktop */
    }

    /* Groceries Page - Two-column Layout */
    .grocery-list-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }

    .add-item-form {
        grid-column: 1 / -1;
        position: sticky;
        top: 0;
        background: var(--bg);
        padding: 16px 0;
        z-index: var(--z-sticky);
    }

    /* Toast Notifications - Top Right */
    #toast {
        bottom: auto;
        top: 24px;
        right: 24px;
        left: auto;
        transform: none;
        width: 400px;
    }

    /* Step Timer - Floating Bottom Right */
    #step-timer {
        position: fixed;
        bottom: 24px;
        right: 24px;
        left: auto;
        transform: none;
        width: 360px;
        max-width: none;
    }

    /* Modal - Constrain Width */
    #confirm-modal .modal-content {
        max-width: 500px;
    }

    /* Enhanced Hover States */
    .meal-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
        border-color: var(--primary);
    }

    .category-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }

    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow);
    }

    .btn-secondary:hover {
        background: var(--surface-alt);
    }

    .add-option-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
        border-color: var(--primary);
    }

    /* Recipe card hover in favorites */
    .recipe-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }
}

/* Large Desktop (1440px and up) */
@media (min-width: 1440px) {
    /* Further expand container */
    .container {
        max-width: 1400px;
    }

    /* Home Page - 4-column favorites */
    .recent-favorites-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Browse Page - 4-column grid */
    .results-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   SETTINGS PAGE COMPONENTS
   ============================================ */

.settings-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-6);
}

.settings-header {
    margin-bottom: var(--space-8);
    text-align: center;
}

.settings-header h2 {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-2);
}

.settings-subtitle {
    font-size: var(--text-base);
    color: var(--text-light);
}

.settings-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.settings-card-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-2);
}

.settings-card-description {
    font-size: var(--text-sm);
    color: var(--text-light);
    margin-bottom: var(--space-6);
}

.version-info {
    font-size: var(--text-sm);
    color: var(--text-light);
    font-family: monospace;
    margin: 0;
}

/* Timer Sound Settings */
.settings-card .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.settings-card .form-group:last-child {
    margin-bottom: 0;
}

.settings-card .form-group label {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
}

.sound-select-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sound-select {
    flex: 1;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    appearance: none;
    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='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%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;
}

.sound-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 159, 63, 0.1);
}

.preview-sound-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.preview-sound-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.preview-sound-btn:active {
    transform: scale(0.95);
}

.preview-sound-btn svg {
    width: 20px;
    height: 20px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.settings-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.settings-form label {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
}

.settings-form input[type="password"] {
    width: 100%;
    padding: var(--space-3);
    font-size: var(--text-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s;
}

.settings-form input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 159, 63, 0.1);
}

.form-help {
    font-size: var(--text-sm);
    color: var(--text-light);
}

.form-error {
    padding: var(--space-3);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: var(--radius-sm);
    color: #991b1b;
    font-size: var(--text-sm);
    font-weight: 500;
}

.form-success {
    padding: var(--space-3);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #10b981;
    border-radius: var(--radius-sm);
    color: #065f46;
    font-size: var(--text-sm);
    font-weight: 500;
}

.form-error.hidden,
.form-success.hidden {
    display: none;
}

/* API Key Card Styles */
.api-key-section {
    margin-top: var(--space-4);
}

.api-key-info {
    color: var(--text-light);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
}

.api-key-display {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--surface-alt, #f3f4f6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-3);
}

.api-key-display-full {
    background: rgba(251, 191, 36, 0.1);
    border-color: #f59e0b;
}

.api-key-display code {
    flex: 1;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: var(--text-sm);
    color: var(--text);
    word-break: break-all;
}

.api-key-copy-btn {
    flex-shrink: 0;
    background: transparent;
    border: none;
    padding: var(--space-2);
    cursor: pointer;
    color: var(--text-light);
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.api-key-copy-btn:hover {
    color: var(--primary);
    background: rgba(245, 159, 63, 0.1);
}

.api-key-copy-btn svg {
    width: 18px;
    height: 18px;
}

.api-key-created {
    font-size: var(--text-xs);
    color: var(--text-light);
    margin-bottom: var(--space-4);
}

.api-key-actions {
    display: flex;
    gap: var(--space-3);
}

.api-key-actions .secondary-btn {
    flex: 1;
}

.api-key-delete-btn {
    color: #dc2626;
    border-color: #dc2626;
}

.api-key-delete-btn:hover {
    background: rgba(220, 38, 38, 0.1);
}

.api-key-warning {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid #f59e0b;
    border-radius: var(--radius);
    margin-bottom: var(--space-3);
    color: #92400e;
    font-size: var(--text-sm);
}

.api-key-warning svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* Bookmarklet styles */
.bookmarklet-no-key {
    margin-top: var(--space-4);
}

.bookmarklet-no-key-message {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid #f59e0b;
    border-radius: var(--radius);
    color: #92400e;
    font-size: var(--text-sm);
}

.bookmarklet-section {
    margin-top: var(--space-4);
}

.bookmarklet-instructions {
    font-size: var(--text-sm);
    color: var(--text-light);
    margin-bottom: var(--space-3);
}

.bookmarklet-drag-container {
    display: flex;
    justify-content: center;
    padding: var(--space-4);
    background: var(--surface-alt, #f3f4f6);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
}

.bookmarklet-drag-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: var(--text-sm);
    border-radius: var(--radius);
    text-decoration: none;
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s;
}

.bookmarklet-drag-link:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.bookmarklet-drag-link:active {
    cursor: grabbing;
}

.bookmarklet-code-container {
    margin-top: var(--space-2);
}

.bookmarklet-code {
    width: 100%;
    padding: var(--space-3);
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: var(--text-xs);
    color: var(--text);
    background: var(--surface-alt, #f3f4f6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    resize: none;
    word-break: break-all;
}

.bookmarklet-help-list {
    margin: var(--space-4) 0 0 0;
    padding-left: var(--space-5);
    font-size: var(--text-sm);
    color: var(--text);
    line-height: 1.8;
}

.bookmarklet-help-list li {
    margin-bottom: var(--space-2);
}

/* Import dropzone styles */
.import-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: var(--space-6);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
}

.import-dropzone:hover,
.import-dropzone.dragover {
    border-color: var(--primary);
    background-color: rgba(245, 159, 63, 0.05);
}

.import-file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3);
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.import-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-1);
    color: var(--text-light);
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background-color 0.2s;
}

.import-clear-btn:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

.import-results {
    margin-top: var(--space-4);
}

.import-success-message {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
}

.import-errors-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: #d97706;
    margin-bottom: var(--space-2);
    font-weight: 500;
}

.import-errors-list {
    margin: 0;
    padding-left: var(--space-5);
    font-size: var(--text-sm);
    color: var(--text-light);
}

.import-errors-list li {
    margin-bottom: var(--space-1);
}

.import-error-message {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border-radius: var(--radius-sm);
}

/* Desktop responsiveness */
@media (min-width: 768px) {
    .settings-wrapper {
        padding: var(--space-8) var(--space-6);
    }

    .settings-card {
        padding: var(--space-8);
    }
}

/* ============================================
   HELP PAGE
   ============================================ */

.help-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-6);
    padding-bottom: 120px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.help-header {
    text-align: center;
    margin-bottom: var(--space-4);
}

.help-header h2 {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-2);
}

.help-subtitle {
    font-size: var(--text-base);
    color: var(--text-light);
}

/* Topic Accordion (outer level) */
.help-topic {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.help-topic-header {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.2s ease;
}

.help-topic-header:hover {
    background: var(--bg);
}

.help-topic-header[aria-expanded="true"] {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.help-topic-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(245, 159, 63, 0.12);
    color: var(--primary);
    flex-shrink: 0;
}

.help-topic-icon svg {
    width: 20px;
    height: 20px;
}

.help-topic-title {
    flex: 1;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text);
}

.help-topic-chevron {
    display: flex;
    align-items: center;
    color: var(--text-light);
    transition: transform 0.3s ease;
}

.help-topic-chevron svg {
    width: 20px;
    height: 20px;
}

.help-topic-header[aria-expanded="true"] .help-topic-chevron {
    transform: rotate(180deg);
}

.help-topic-content {
    padding: 0;
}

.help-topic-content[hidden] {
    display: none;
}

/* FAQ Accordion (inner level) */
.help-faq {
    border-bottom: 1px solid var(--border);
}

.help-faq:last-child {
    border-bottom: none;
}

.help-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text);
    transition: background 0.2s ease;
}

.help-faq-question:hover {
    background: rgba(245, 159, 63, 0.04);
}

.help-faq-question span {
    flex: 1;
    padding-right: 12px;
}

.help-faq-question svg {
    width: 16px;
    height: 16px;
    color: var(--text-light);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.help-faq-question[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.help-faq-answer {
    padding: 0 20px 16px 20px;
    color: var(--text-light);
    font-size: var(--text-sm);
    line-height: 1.7;
}

.help-faq-answer[hidden] {
    display: none;
}

.help-faq-answer p {
    margin: 0 0 12px 0;
}

.help-faq-answer p:last-child {
    margin-bottom: 0;
}

.help-faq-answer ul {
    margin: 12px 0;
    padding-left: 20px;
}

.help-faq-answer li {
    margin-bottom: 8px;
}

.help-faq-answer li:last-child {
    margin-bottom: 0;
}

.help-faq-answer strong {
    color: var(--text);
    font-weight: 600;
}

/* Help page desktop responsiveness */
@media (min-width: 768px) {
    .help-wrapper {
        padding: var(--space-8) var(--space-6);
    }

    .help-topic-header {
        padding: 20px 24px;
    }

    .help-faq-question {
        padding: 18px 24px;
    }

    .help-faq-answer {
        padding: 0 24px 20px 24px;
    }
}

/* Suggestion Box */
.suggestion-box {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.suggestion-box h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text);
}

.suggestion-box > p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0 0 16px 0;
}

.suggestion-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    background: var(--surface);
    color: var(--text);
}

.suggestion-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 159, 63, 0.1);
}

.suggestion-form textarea::placeholder {
    color: var(--text-light);
}

.suggestion-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.suggestion-footer .char-count {
    font-size: 0.8rem;
    color: var(--text-light);
}

.suggestion-footer .btn-primary {
    padding: 8px 20px;
    font-size: 0.9rem;
}

/* Thank You Modal */
.thank-you-content {
    text-align: center;
    padding: 32px 24px;
}

.thank-you-icon {
    margin-bottom: 16px;
}

.thank-you-icon svg {
    width: 64px;
    height: 64px;
    color: var(--success, #22c55e);
}

.thank-you-content .modal-title {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.thank-you-content .modal-message {
    color: var(--text-light);
    margin-bottom: 24px;
}

.thank-you-content .modal-actions {
    justify-content: center;
}

.modal-btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 32px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
}

.modal-btn-primary:hover {
    background: var(--primary-dark);
}

/* Store Form Styles */
.store-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.store-form .form-row {
    display: flex;
    gap: 12px;
}

.store-form .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.store-form .form-group-sm {
    flex: 0 0 80px;
}

.store-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.store-form input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--surface);
    width: 100%;
    box-sizing: border-box;
}

.store-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.store-form .modal-actions {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
    .store-form .form-row {
        flex-direction: column;
    }

    .store-form .form-group-sm {
        flex: 1;
    }
}

.help-chatbot {
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.help-chatbot-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 600;
    font-size: var(--text-base);
}

.help-chatbot-header svg {
    width: 20px;
    height: 20px;
}

.help-chat-messages {
    max-height: 300px;
    min-height: 120px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg);
}

.help-chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: var(--text-sm);
    line-height: 1.5;
}

.help-chat-message p {
    margin: 0;
}

.help-chat-bot {
    align-self: flex-start;
    background: var(--bg-secondary);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.help-chat-user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.help-chat-form {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.help-chat-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: var(--text-sm);
    outline: none;
    transition: border-color 0.2s ease;
}

.help-chat-form input:focus {
    border-color: var(--primary);
}

.help-chat-form input::placeholder {
    color: var(--text-muted);
}

.help-chat-submit {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.help-chat-submit:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.help-chat-submit svg {
    width: 18px;
    height: 18px;
}

/* Loading dots animation */
.help-chat-loading .loading-dots {
    display: inline-flex;
    gap: 4px;
}

.help-chat-loading .loading-dots span {
    animation: dotPulse 1.4s ease-in-out infinite;
    font-weight: bold;
}

.help-chat-loading .loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.help-chat-loading .loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 60%, 100% {
        opacity: 0.3;
    }
    30% {
        opacity: 1;
    }
}

/* Help chatbot desktop responsiveness */
@media (min-width: 768px) {
    .help-chat-messages {
        max-height: 350px;
    }

    .help-chat-message {
        max-width: 75%;
    }
}

/* ============================================
   TONIGHT'S INGREDIENTS PAGE
   ============================================ */

.tonight-ingredients-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    padding-bottom: 120px;
}

.tonight-ingredients-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tonight-ingredients-header .back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s ease;
}

.tonight-ingredients-header .back-link:hover {
    background: var(--bg);
}

.tonight-ingredients-header .back-link svg {
    width: 24px;
    height: 24px;
}

.tonight-ingredients-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

/* Recipe summary with color legend */
.tonight-recipes-summary {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 12px 16px;
}

.tonight-summary-label {
    font-size: 14px;
    color: var(--text-light);
    margin: 0 0 12px 0;
}

.tonight-summary-label strong {
    color: var(--text);
}

.recipe-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recipe-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recipe-legend-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    flex-shrink: 0;
}

.recipe-legend-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

/* Recipe initials badges */
.recipe-initials {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin-left: 8px;
}

.recipe-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
}

/* Empty state */
.tonight-ingredients-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-light);
}

.tonight-ingredients-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.tonight-ingredients-empty p {
    margin: 0 0 24px;
    font-size: 18px;
}

/* Desktop responsiveness */
@media (min-width: 768px) {
    .tonight-ingredients-wrapper {
        padding: 32px 24px;
        max-width: 800px;
        margin: 0 auto;
    }

    .tonight-ingredients-header h2 {
        font-size: 28px;
    }
}

/* =================================
   Tonight's Cooking - Tabbed Interface
   ================================= */

.tonight-cook-wrapper {
    padding: 16px 0;
    padding-bottom: calc(var(--toolbar-height) + 300px);
}

.tonight-cook-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px 16px;
}

.tonight-cook-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

/* Tab Container */
.cook-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 0;
    z-index: 100;
}

.cook-tabs::-webkit-scrollbar {
    display: none;
}

.cook-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-family: inherit;
    font-size: 14px;
}

.cook-tab:hover {
    border-color: rgba(245, 159, 63, 0.3);
    background: rgba(245, 159, 63, 0.08);
}

.cook-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.cook-tab-initials {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.cook-tab.active .cook-tab-initials {
    background: rgba(255, 255, 255, 0.25);
}

.cook-tab-name {
    font-weight: 600;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tab with active timer indicator */
.cook-tab.has-timer::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green, #4ade80);
    margin-left: 4px;
    animation: timer-pulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes timer-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

/* Panel Container */
.cook-panels {
    padding: 0;
    padding-bottom: 250px;
}

.cook-panel {
    display: none;
    padding: 16px;
}

.cook-panel.active {
    display: block;
}

.cook-panel-header {
    margin-bottom: 20px;
}

.cook-panel-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px;
}

.cook-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.cook-progress-track {
    flex: 1;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.cook-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.cook-progress-text {
    font-size: 12px;
    color: var(--text-light);
    min-width: 32px;
    text-align: right;
}

/* Progress Overview - shows all recipes at once */
.cook-progress-overview {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cook-overview-header {
    margin-bottom: 12px;
}

.cook-overview-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cook-overview-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cook-overview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 8px;
    margin: -6px -8px;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}

.cook-overview-item:hover {
    background: var(--bg);
}

.cook-overview-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.cook-overview-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    min-width: 120px;
    flex-shrink: 0;
}

.cook-overview-track-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.cook-overview-track {
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    min-width: 40px;
}

.cook-overview-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.cook-overview-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    min-width: 50px;
    text-align: right;
}

.cook-panel-meta {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
}

.cook-panel-content {
    /* Uses existing step-container styles */
}

/* Cook Timer (floating, similar to step-timer) */
.cook-timer {
    position: fixed;
    bottom: calc(var(--toolbar-height) + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    max-width: 500px;
    width: calc(100% - 48px);
}

.cook-timer-content {
    background: var(--surface);
    border-radius: 20px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    border: 2px solid var(--primary);
}

.cook-timer-recipe-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    text-align: center;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cook-timer-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.cook-timer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.cook-timer-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.cook-timer-display {
    font-size: 48px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    min-width: 100px;
    text-align: center;
}

.cook-timer-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
}

.cook-timer-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 4px;
}

.cook-timer-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(245, 159, 63, 0.3);
}

.cook-timer-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.cook-timer-btn:active {
    transform: scale(0.95);
}

.cook-timer-btn svg {
    width: 18px;
    height: 18px;
}

.cook-timer-btn-secondary {
    background: rgba(245, 159, 63, 0.15);
    color: var(--primary);
    box-shadow: none;
}

.cook-timer-btn-secondary:hover {
    background: rgba(245, 159, 63, 0.25);
}

/* Empty state */
.tonight-cook-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-light);
}

.tonight-cook-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.tonight-cook-empty p {
    margin: 0 0 24px;
    font-size: 18px;
}

/* Primary action button style for Cook button on home page */
.home-section-action-primary {
    background: var(--primary);
    color: white !important;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
}

.home-section-action-primary:hover {
    background: var(--primary-dark);
}

/* Mobile Adjustments for Cook Page */
@media (max-width: 480px) {
    .cook-tabs {
        padding: 10px 12px;
        gap: 6px;
    }

    .cook-tab {
        padding: 8px 12px;
    }

    .cook-tab-name {
        max-width: 60px;
        font-size: 13px;
    }

    .cook-timer-content {
        padding: 10px 14px;
    }

    .cook-timer-label {
        font-size: 9px;
    }

    .cook-timer-display {
        font-size: 39px;
        min-width: 90px;
    }

    .cook-timer-group {
        gap: 12px;
    }

    .cook-timer-btn {
        width: 36px;
        height: 36px;
    }

    .cook-timer-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Desktop adjustments for Cook Page */
@media (min-width: 768px) {
    .tonight-cook-wrapper {
        padding: 24px 0;
        max-width: 900px;
        margin: 0 auto;
    }

    .tonight-cook-header {
        padding: 0 24px 20px;
    }

    .tonight-cook-header h2 {
        font-size: 28px;
    }

    .cook-tabs {
        justify-content: center;
        padding: 16px 24px;
    }

    .cook-tab-name {
        max-width: 150px;
    }

    .cook-panel {
        padding: 24px;
    }
}

@media (min-width: 1024px) {
    .cook-timer {
        width: auto;
        min-width: 420px;
        /* Offset for 240px desktop sidebar: center relative to content area */
        left: calc(50% + 120px);
    }

    .cook-timer-display {
        font-size: 54px;
        min-width: 110px;
    }

    .cook-timer-label {
        font-size: 11px;
    }
}

/* ============================================
   CATEGORY FILTER & DISPLAY STYLES
   ============================================ */

/* Category filter bar on browse page */
.category-filter {
    padding: 12px 16px 0;
    background: var(--surface);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    margin: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-filter::-webkit-scrollbar {
    display: none;
}

.category-pills {
    display: flex;
    gap: 8px;
    min-width: max-content;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-pill:hover {
    background: rgba(245, 159, 63, 0.08);
    border-color: var(--primary);
}

.category-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Favorites toggle */
.favorites-toggle {
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.favorites-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.favorites-toggle-btn svg {
    width: 16px;
    height: 16px;
}

.favorites-toggle-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: #ef4444;
    color: #ef4444;
}

.favorites-toggle-btn.active {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.favorites-toggle-btn.active svg {
    fill: white;
}

/* Filter groups (collapsible) */
.filter-group {
    padding-top: 12px;
    border-bottom: 1px solid var(--border);
}

.filter-group:last-child {
    border-bottom: none;
    padding-bottom: 14px;
}

.filter-group:last-child .filter-group-pills {
    padding-bottom: 0;
}

.filter-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.filter-group-chevron svg {
    width: 16px;
    height: 16px;
    color: var(--text-light);
}

.filter-group.collapsed .filter-group-chevron {
    transform: rotate(-90deg);
}

.filter-group-label {
    flex: 1;
    text-align: left;
}

.filter-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.filter-group-count.hidden {
    display: none;
}

.filter-group-pills {
    overflow: hidden;
    max-height: 500px;
    padding-bottom: 14px;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    opacity: 1;
}

.filter-group.collapsed .filter-group-pills {
    max-height: 0;
    opacity: 0;
}

/* Cuisine pills (same styling as category pills) */
.cuisine-pills {
    display: flex;
    gap: 8px;
    min-width: max-content;
}

.cuisine-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cuisine-pill:hover {
    background: rgba(245, 159, 63, 0.08);
    border-color: var(--primary);
}

.cuisine-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Browse page search */
.browse-search {
    padding: 0 16px 6px;
}

.browse-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.15s ease;
}

.browse-search-input::placeholder {
    color: var(--text-light);
}

.browse-search-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Category pills on recipe detail page */
.recipe-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

.recipe-category-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: rgba(245, 159, 63, 0.15);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Category checkboxes in edit modal */
.edit-categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.edit-category-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-category-checkbox:hover {
    background: rgba(245, 159, 63, 0.08);
    border-color: var(--primary);
}

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

.edit-category-checkbox span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.edit-category-checkbox:has(input:checked) {
    background: rgba(245, 159, 63, 0.12);
    border-color: var(--primary);
}

@media (min-width: 480px) {
    .edit-categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .category-filter {
        padding: 16px 24px;
        overflow-x: visible;
    }

    .category-pills,
    .cuisine-pills {
        flex-wrap: wrap;
        gap: 10px;
        min-width: unset;
    }

    .category-pill,
    .cuisine-pill {
        padding: 10px 20px;
        font-size: 15px;
    }

    .filter-group-header {
        padding: 10px 0;
        font-size: 14px;
    }

    .edit-categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   VIEW TOGGLE & LIST VIEW STYLES
   ============================================ */

/* Results page header with toggle */
.results-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    gap: 16px;
}

.results-page-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.results-header-left {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.recipe-count {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    margin-top: -2px;
    text-align: center;
}

/* View toggle buttons */
.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 4px;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: calc(var(--radius) - 2px);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    background: rgba(245, 159, 63, 0.1);
    color: var(--primary);
}

.view-toggle-btn.active {
    background: var(--primary);
    color: white;
}

.view-toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* Meals list container modes */
.meals-list-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.meals-list-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* List item styles */
.meal-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.meal-list-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.meal-list-item:active {
    transform: translateY(0);
}

.meal-list-image {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg);
}

.meal-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.meal-list-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 24px;
    font-weight: 700;
}

.meal-list-content {
    flex: 1;
    min-width: 0;
}

.meal-list-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meal-list-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-light);
}

.meal-list-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meal-list-time svg {
    width: 14px;
    height: 14px;
}

.meal-list-categories {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meal-list-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.meal-list-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.meal-list-action:hover {
    background: rgba(245, 159, 63, 0.15);
    color: var(--primary);
}

.meal-list-action.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 159, 63, 0.4);
}

.meal-list-action.active svg {
    fill: currentColor;
}

.meal-list-action[data-action="favorite"].active {
    color: white;
    background: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.meal-list-action svg {
    width: 18px;
    height: 18px;
}

@media (min-width: 768px) {
    .results-page-header {
        padding: 20px 24px;
    }

    .results-page-header h2 {
        font-size: 28px;
    }

    .view-toggle-btn {
        width: 40px;
        height: 40px;
    }

    .meal-list-item {
        padding: 16px;
        gap: 16px;
    }

    .meal-list-image {
        width: 72px;
        height: 72px;
    }

    .meal-list-title {
        font-size: 17px;
    }

    .meal-list-meta {
        font-size: 14px;
    }

    .meal-list-action {
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   ADMIN PORTAL STYLES (Mobile-First)
   ============================================ */

/* Base Mobile Styles */
.page-admin .container {
    max-width: 1200px;
    padding-bottom: 100px;
}

.admin-wrapper {
    padding: 16px 12px;
}

.admin-header {
    margin-bottom: 20px;
}

.admin-header h2 {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.admin-subtitle {
    font-size: var(--text-sm);
    color: var(--text-light);
}

/* Admin Tabs - Horizontal scroll on mobile */
.admin-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar {
    display: none;
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-light);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.admin-tab svg {
    width: 16px;
    height: 16px;
}

/* Hide tab text on very small screens, show only icon */
.admin-tab span {
    display: none;
}

/* Show tab text on larger phones (400px+) */
@media (min-width: 400px) {
    .admin-tab span {
        display: inline;
    }
}

.admin-tab:hover {
    border-color: var(--primary);
    color: var(--text);
}

.admin-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Admin Tab Content */
.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

/* Stats Grid - 2 columns on mobile */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.admin-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-stat-icon {
    width: 32px;
    height: 32px;
    background: var(--bg);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.admin-stat-icon svg {
    width: 16px;
    height: 16px;
}

.admin-stat-info {
    display: flex;
    flex-direction: column;
}

.admin-stat-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.admin-stat-label {
    font-size: var(--text-xs);
    color: var(--text-light);
}

.admin-stat-sub {
    font-size: 10px;
    color: var(--text-light);
    margin-top: auto;
}

/* Admin Toolbar */
.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.admin-toolbar .admin-search-bar {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.admin-toolbar .btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-toolbar .btn svg {
    width: 16px;
    height: 16px;
}

/* Admin Search */
.admin-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.admin-search-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px; /* Prevents iOS zoom */
    background: var(--surface);
}

.admin-search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.admin-search-btn {
    padding: 10px 12px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.admin-search-btn:hover {
    background: var(--primary-dark);
}

/* Admin Filter Row */
.admin-filter-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface);
}

.admin-sort-select select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--surface);
    cursor: pointer;
    min-width: 140px;
}

.admin-sort-select select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Admin Selection Bar */
.admin-selection-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    min-height: 36px;
}

.admin-selection-bar .recipe-count {
    margin: 0;
    text-align: left;
}

.selection-count {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
}

.admin-th-checkbox {
    width: 40px;
    text-align: center;
}

.admin-td-checkbox {
    text-align: center;
}

.admin-card-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
}

.admin-card-item {
    position: relative;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.admin-search-btn svg {
    width: 18px;
    height: 18px;
}

/* Mobile Card List (replaces table on mobile) */
.admin-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-card-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.admin-card-title {
    font-weight: 600;
    color: var(--text);
    font-size: var(--text-sm);
    word-break: break-word;
    flex: 1;
    margin-right: 8px;
}

.admin-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: var(--text-xs);
    color: var(--text-light);
    margin-bottom: 10px;
}

.admin-card-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.admin-card-meta-item svg {
    width: 12px;
    height: 12px;
}

.admin-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* Admin Table - Hidden on mobile by default */
.admin-table-container {
    display: none;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

/* Give title column more space */
.admin-table .admin-td-title {
    min-width: 250px;
    max-width: 400px;
}

.admin-loading,
.admin-empty,
.admin-error {
    text-align: center;
    color: var(--text-light);
    padding: 40px 16px !important;
}

.admin-error {
    color: var(--danger);
}

/* Admin Actions */
.admin-actions {
    display: flex;
    gap: 8px;
}

.admin-action-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.admin-action-btn svg {
    width: 18px;
    height: 18px;
}

.admin-action-btn:hover,
.admin-action-btn:active {
    border-color: var(--text-light);
    color: var(--text);
}

.admin-action-delete:hover,
.admin-action-delete:active {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Status Badges */
.admin-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: var(--text-xs);
    font-weight: 500;
}

.admin-status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.admin-status-disabled {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Admin Role Badge */
.admin-role-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    vertical-align: middle;
}

.admin-role-badge.admin-role-env {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

/* Admin action button locked state */
.admin-action-btn.admin-action-locked {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Admin action button shared state - solid green with white icon */
.admin-action-btn.admin-action-shared {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.admin-action-btn.admin-action-shared:hover {
    background: var(--success-light);
    border-color: var(--success-light);
    color: #fff;
}

/* Admin Links */
.admin-link {
    color: var(--primary);
    text-decoration: none;
}

.admin-link:hover {
    text-decoration: underline;
}

.admin-text-muted {
    color: var(--text-light);
}

.admin-icon-small {
    width: 14px;
    height: 14px;
    margin-left: 4px;
    vertical-align: middle;
    color: var(--text-light);
}

/* Admin Pagination - Stacked on mobile */
.admin-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 0;
}

.admin-pagination-info {
    font-size: var(--text-sm);
    color: var(--text-light);
    order: 2;
}

.admin-pagination-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
    order: 1;
    flex-wrap: wrap;
    justify-content: center;
}

.admin-pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: var(--text-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.admin-pagination-btn:hover,
.admin-pagination-btn:active {
    border-color: var(--primary);
    color: var(--primary);
}

.admin-pagination-btn-active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.admin-pagination-btn svg {
    width: 16px;
    height: 16px;
}

.admin-pagination-ellipsis {
    padding: 0 4px;
    color: var(--text-light);
}

/* Suggestions List */
.admin-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-suggestion-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}

.admin-suggestion-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.admin-suggestion-user {
    font-weight: 600;
    color: var(--text);
    font-size: var(--text-sm);
    word-break: break-word;
}

.admin-suggestion-date {
    font-size: var(--text-xs);
    color: var(--text-light);
}

.admin-suggestion-message {
    font-size: var(--text-sm);
    color: var(--text);
    line-height: 1.5;
    white-space: pre-wrap;
}

/* ============================================
   SPONSOR MANAGEMENT (Admin)
   ============================================ */
.admin-sponsor-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    max-width: 600px;
}

.admin-sponsor-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--text);
}

.admin-sponsor-subtitle {
    font-size: var(--text-sm);
    color: var(--text-light);
    margin: 0 0 20px;
}

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

.sponsor-form .form-row {
    display: flex;
    gap: 12px;
}

.sponsor-form .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sponsor-form .form-group-sm {
    flex: 0 0 100px;
}

.sponsor-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.sponsor-form input[type="text"],
.sponsor-form input[type="url"],
.sponsor-form input[type="number"],
.sponsor-form input[type="file"] {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--surface);
    width: 100%;
    box-sizing: border-box;
}

.sponsor-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.sponsor-form .form-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.sponsor-form .modal-actions {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Position options (radio buttons) */
.position-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

.radio-label {
    font-size: var(--text-sm);
    color: var(--text);
    min-width: 120px;
}

.position-input {
    width: 70px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    background: var(--input-bg);
}

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

.position-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.position-select {
    flex: 1;
    max-width: 200px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    background: var(--input-bg);
}

.position-select:focus {
    outline: none;
    border-color: var(--primary);
}

.position-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .sponsor-form .form-row {
        flex-direction: column;
    }

    .sponsor-form .form-group-sm {
        flex: 1;
    }

    .radio-option {
        flex-wrap: wrap;
    }

    .radio-label {
        min-width: auto;
    }

    .position-select {
        max-width: 100%;
        width: 100%;
    }
}

.sponsor-dropzone {
    position: relative;
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.sponsor-dropzone:hover {
    border-color: var(--primary);
    background: rgba(245, 159, 63, 0.05);
}

.sponsor-dropzone.drag-over {
    border-color: var(--primary);
    background: rgba(245, 159, 63, 0.1);
}

.sponsor-dropzone.has-image {
    border-style: solid;
    cursor: default;
}

.sponsor-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.sponsor-dropzone.has-image .sponsor-file-input {
    display: none;
}

.sponsor-preview {
    padding: 20px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.sponsor-preview-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

.sponsor-dropzone-or {
    font-size: 13px;
    color: var(--primary);
}

.sponsor-preview-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
}

.sponsor-image-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.sponsor-image-delete:hover {
    background: var(--danger);
    transform: scale(1.1);
}

.sponsor-image-delete svg {
    width: 18px;
    height: 18px;
}

.sponsor-image-delete.hidden {
    display: none;
}

.sponsor-analytics {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.sponsor-analytics h4 {
    font-size: var(--text-base);
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--text);
}

.sponsor-stats {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* Sponsors List (Multi-ad) */
.sponsors-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.sponsor-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sponsor-card:hover {
    border-color: var(--primary-light);
}

.sponsor-card-active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(74, 123, 60, 0.05) 0%, var(--card-bg) 100%);
    box-shadow: 0 0 0 1px var(--primary);
}

.sponsor-card-image {
    width: 100%;
    border-radius: 4px;
    background: var(--input-bg);
}

.sponsor-card-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.sponsor-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.sponsor-card-details {
    flex: 1;
    min-width: 0;
}

.sponsor-card-url {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    word-break: break-all;
    margin-bottom: 2px;
}

.sponsor-card-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.sponsor-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.sponsor-active-badge,
.btn-activate {
    display: inline-block;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
    min-width: 70px;
}

.sponsor-active-badge {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
}

.btn-activate {
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-activate:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.sponsors-add-container {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    padding-top: 16px;
}

.btn-sm {
    font-size: var(--text-xs);
    padding: 6px 12px;
}

@media (max-width: 600px) {
    .sponsor-card-info {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .sponsor-card-actions {
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid var(--border);
    }
}

/* Toggle Switch */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text);
}

.toggle-label input {
    display: none;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-label input:checked + .toggle-switch {
    background: var(--primary);
}

.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(20px);
}

/* ============================================
   SPONSORED AD (Grocery List)
   ============================================ */
.grocery-item.sponsored-ad {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,1) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    margin: 8px 0;
    overflow: hidden;
}

.sponsored-ad-link {
    display: block;
    text-decoration: none;
    position: relative;
}

.sponsored-ad-image {
    width: 100%;
    height: auto;
    display: block;
}

.sponsored-ad-label {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ============================================
   ADMIN RESPONSIVE - Tablet (768px+)
   ============================================ */
@media (min-width: 768px) {
    .admin-wrapper {
        padding: 24px 20px;
    }

    .admin-header h2 {
        font-size: var(--text-2xl);
    }

    .admin-tab {
        padding: 10px 16px;
    }

    .admin-tabs {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
    }

    /* Stats grid - 3 columns on tablet */
    .admin-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .admin-stat-card {
        padding: 18px;
    }

    .admin-stat-icon {
        width: 40px;
        height: 40px;
    }

    .admin-stat-icon svg {
        width: 20px;
        height: 20px;
    }

    .admin-stat-value {
        font-size: var(--text-2xl);
    }

    .admin-stat-label {
        font-size: var(--text-sm);
    }

    .admin-stat-sub {
        font-size: var(--text-xs);
    }

    /* Show table, hide card list on tablet+ */
    .admin-table-container {
        display: block;
    }

    .admin-card-list {
        display: none;
    }

    /* Pagination row layout */
    .admin-pagination {
        flex-direction: row;
        justify-content: space-between;
    }

    .admin-pagination-info {
        order: 1;
    }

    .admin-pagination-buttons {
        order: 2;
    }

    /* Suggestion header row */
    .admin-suggestion-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .admin-suggestion-card {
        padding: 16px;
    }
}

/* ============================================
   ADMIN RESPONSIVE - Desktop (1024px+)
   ============================================ */
@media (min-width: 1024px) {
    .admin-wrapper {
        padding: 32px 24px;
    }

    .admin-header h2 {
        font-size: var(--text-3xl);
    }

    .admin-tab {
        padding: 12px 20px;
    }

    /* Stats grid - auto-fill on desktop */
    .admin-stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }

    .admin-stat-card {
        padding: 24px;
    }

    .admin-action-btn {
        width: 32px;
        height: 32px;
    }

    .admin-action-btn svg {
        width: 16px;
        height: 16px;
    }

    .admin-pagination-btn {
        min-width: 32px;
        height: 32px;
    }
}

/* ============================================
   Category Order Page
   ============================================ */

.category-order-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.category-order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.category-order-item:hover {
    background: var(--bg-light);
}

.category-order-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
}

/* Drag handle */
.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: var(--text-muted);
    cursor: grab;
    touch-action: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-handle svg {
    width: 20px;
    height: 20px;
}

/* SortableJS drag states */
.sortable-ghost {
    opacity: 0.4;
    background: var(--primary-light);
    border-color: var(--primary);
}

.sortable-chosen {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sortable-drag {
    opacity: 1;
}

.category-order-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.category-order-actions .secondary-btn,
.category-order-actions .primary-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Back link styling */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 8px;
    transition: color 0.15s ease;
}

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

.back-link svg {
    width: 16px;
    height: 16px;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .category-order-actions {
        flex-direction: column;
    }

    .category-order-actions .secondary-btn,
    .category-order-actions .primary-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   SHARED RECIPE FORM STYLES
   ============================================ */

.shared-ingredient-row,
.shared-step-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.shared-ingredient-row input,
.shared-step-row textarea,
.shared-step-row input {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--white);
}

.shared-ingredient-row input:focus,
.shared-step-row textarea:focus,
.shared-step-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.15);
}

.shared-step-row textarea {
    min-height: 60px;
    resize: vertical;
}

.shared-step-row .step-number {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 6px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    flex-shrink: 0;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.btn-icon.btn-danger {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-icon.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.admin-copy-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 2px 8px;
    background: var(--bg-light);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

/* Shared Recipe Import Section */
.shared-import-section {
    margin-bottom: 16px;
}

.import-url-row {
    display: flex;
    gap: 8px;
}

.import-url-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.import-url-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.15);
}

.import-url-row .btn {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.import-url-row .btn svg {
    width: 16px;
    height: 16px;
}

.import-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.import-divider::before,
.import-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.import-divider span {
    padding: 0 12px;
}

/* ============================================
   ACTION BUTTON COMPONENT
   Modular button with loading/success/error states
   All status messages display within the button
   ============================================ */

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 200px;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* Default state - accent color */
.action-btn--default {
    background: var(--primary, #f59f3f);
    color: white;
}

.action-btn--default:hover {
    background: var(--primary-dark, #d97706);
}

.action-btn--default:active {
    transform: scale(0.98);
}

/* Loading state */
.action-btn--loading {
    background: var(--text-light, #8d8378);
    color: white;
    cursor: wait;
    pointer-events: none;
}

/* Success state - green */
.action-btn--success {
    background: var(--success, #10b981);
    color: white;
    cursor: default;
}

.action-btn--success:hover {
    background: var(--success, #10b981);
}

/* Error state */
.action-btn--error {
    background: var(--danger, #ef4444);
    color: white;
    cursor: pointer;
}

.action-btn--error:hover {
    background: var(--danger-dark, #dc2626);
}

/* Disabled state */
.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Spinner inside button */
.action-btn .action-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: action-btn-spin 0.8s linear infinite;
}

@keyframes action-btn-spin {
    to { transform: rotate(360deg); }
}

/* Icon inside button */
.action-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Text truncation for long messages */
.action-btn-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

