/* ===========================
   Design Tokens
   =========================== */
:root {
    /* Smart Chef Red Theme */
    --primary-red: #DC2626;
    --primary-red-dark: #B91C1C;
    --primary-red-light: #EF4444;
    --primary-orange: var(--primary-red);
    --primary-green: #4CAF50;
    --accent-yellow: #FBBF24;
    --flame-orange: #F97316;
    --chef-gold: #D97706;
    --primary-gradient: linear-gradient(135deg, var(--primary-red), var(--flame-orange));
    --light-cream: #FEF2F2;
    --dark-text: #2D3436;
    --gray-text: #636E72;
    --light-gray: #DFE6E9;
    --white: #FFFFFF;
    --error-red: #E74C3C;
    --success-green: #27AE60;
    --surface-strong: #FFFFFF;
    --surface-soft: #FEF7F4;
    --surface-muted: #FFF7ED;
    --border-strong: #DFE6E9;
    --border-muted: rgba(0, 0, 0, 0.08);

    /* Shadows & Borders */
    --border-radius: 16px;
    --border-radius-small: 12px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* Spacing */
    --nav-height: 70px;
    --header-height: 60px;
}

/* ===========================
   Base Reset & Typography
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--light-cream);
    color: var(--dark-text);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: var(--nav-height);
}

/* ===========================
   Layout Containers
   =========================== */
/* App Container */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
}

/* ===========================
   Header & Status
   =========================== */
/* Header */
.app-header {
    background: var(--primary-gradient);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2rem;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Offline Banner */
.offline-banner {
    background: #fff4ed;
    border-bottom: 1px solid rgba(217, 119, 6, 0.2);
    padding: 12px 20px;
    position: sticky;
    top: 72px;
    z-index: 150;
}

.offline-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.offline-icon {
    font-size: 1.3rem;
}

.offline-text p {
    margin: 0 0 8px 0;
    color: var(--dark-text);
    font-weight: 600;
}

/* ===========================
   Screen Layout
   =========================== */
/* Screen Container */
.screen {
    display: none;
    padding: 20px;
    min-height: calc(100vh - var(--nav-height) - var(--header-height));
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* ===========================
   Bottom Navigation
   =========================== */
/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 1000;
    max-width: 600px;
    margin: 0 auto;
    border-top: 1px solid var(--border-muted);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    color: var(--gray-text);
    text-decoration: none;
    position: relative;
    gap: 4px;
}
/* Icon Styles */
.nav-item .nav-icon,
.nav-item .nav-icon-active {
    font-size: 1.5rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

/* Zeige outline Icon, verstecke filled */
.nav-item .nav-icon {
    display: block;
}

.nav-item .nav-icon-active {
    display: none;
}

/* Active State: Zeige filled Icon, verstecke outline */
.nav-item.active .nav-icon {
    display: none;
}

.nav-item.active .nav-icon-active {
    display: block;
}

.nav-item .nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}

/* Hover State */
.nav-item:hover {
    color: var(--primary-orange);
}

.nav-item:hover .nav-icon {
    transform: translateY(-2px);
}

/* Active State */
.nav-item.active {
    color: var(--primary-orange);
}

.nav-item.active .nav-icon-active {
    transform: scale(1.1);
}

/* Active Indicator Dot */
.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--primary-orange);
    border-radius: 50%;
}

/* Tap Feedback */
.nav-item:active {
    transform: scale(0.95);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .bottom-nav {
        background: var(--surface-strong);
        border-top-color: var(--border-muted);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }

    .nav-item {
        color: var(--gray-text);
    }

    .nav-item:hover,
    .nav-item.active {
        color: var(--primary-orange);
    }
}

/* ===========================
   Home Screen - Input & Filters
   =========================== */
/* Home Screen - Ingredient Input */
.search-container {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.chef-kisses-hint {
    font-size: 0.9rem;
    color: var(--gray-text);
    margin-top: 4px;
}

.chef-kisses-hint.depleted {
    color: var(--error-red);
    font-weight: 600;
}

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

.section-subtitle {
    color: var(--gray-text);
    font-size: 0.9rem;
}

.filter-icon-btn {
    background: var(--light-gray);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    font-size: 1.25rem; /* Angepasst für Bootstrap Icons */
    color: var(--gray-text);
}

.filter-icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--primary-orange);
}

.filter-icon-btn.active {
    background: rgba(220, 38, 38, 0.12);
    color: var(--primary-orange);
    border: 2px solid rgba(185, 28, 28, 0.3);
}


/* Verbessertes Filter Panel */
.filter-panel {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    padding: 0;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.filter-section {
    padding: 16px;
    border-bottom: 1px solid var(--light-gray);
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.filter-section-icon {
    width: 32px;
    height: 32px;
    background: var(--light-cream);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--primary-orange);
}

.filter-section-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark-text);
}

.filter-section-subtitle {
    font-size: 0.85rem;
    color: var(--gray-text);
    margin-top: 2px;
}

/* Kompaktere Filter-Row */
.filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.filter-row-text {
    flex: 1;
    min-width: 0;
}

.filter-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark-text);
    margin-bottom: 2px;
}

.filter-description {
    color: var(--gray-text);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Kompaktere Option Chips */
.filter-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.option-chip {
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    padding: 8px 12px;
    background: var(--light-cream);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-text);
}

.option-chip:hover {
    border-color: var(--primary-orange);
    color: var(--primary-orange);
    background: var(--white);
}

.option-chip.active {
    background: var(--primary-orange);
    color: white;
    border-color: var(--primary-orange);
}

/* Kompaktere Portion Control im Filter */
.filter-panel .portion-control {
    border-radius: 8px;
}

.filter-panel .portion-btn {
    width: 34px;
    height: 36px;
    font-size: 1rem;
}

.filter-panel .portion-control input {
    width: 48px;
    padding: 8px 4px;
    font-size: 0.95rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--light-gray);
    transition: 0.3s;
    border-radius: 28px;
    box-shadow: var(--shadow-sm);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-gradient);
}

.toggle-switch input:disabled + .toggle-slider {
    cursor: not-allowed;
    opacity: 0.6;
}

.recipes-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.recipes-filter-bar.disabled {
    opacity: 0.65;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* ===========================
   Form Inputs & Buttons
   =========================== */
.search-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-small {
    padding: 10px 16px;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

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

.btn-secondary:hover {
    background: #45a049;
}

.btn-outline {
    background: var(--white);
    color: var(--primary-orange);
    border: 2px solid var(--primary-orange);
}

.btn-outline:hover {
    background: var(--primary-orange);
    color: white;
}

.btn-ghost {
    background: var(--surface-muted);
    color: var(--dark-text);
    border: 1px solid var(--light-gray);
    box-shadow: var(--shadow-sm);
}

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

/* ===========================
   Autocomplete & Suggestions
   =========================== */
/* Custom Autocomplete Dropdown */
.autocomplete-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-input.has-addon {
    padding-right: 50px; /* Platz für den Button */
}

.input-addon-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary-green);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: background 0.2s, transform 0.1s;
}

.input-addon-btn:hover {
    background: #45a049;
}

.input-addon-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 2px solid var(--primary-orange);
    border-top: none;
    border-radius: 0 0 var(--border-radius-small) var(--border-radius-small);
    max-height: 240px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 500;
    box-shadow: var(--shadow-md);
    display: none;
}

.suggestions-dropdown.visible {
    display: block;
}

.suggestions-dropdown li {
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--light-gray);
    font-size: 1rem;
    transition: background 0.15s;
}

.suggestions-dropdown li:last-child {
    border-bottom: none;
}

.suggestions-dropdown li:hover,
.suggestions-dropdown li.highlighted {
    background: var(--light-cream);
}

.suggestions-dropdown li:active {
    background: rgba(220, 38, 38, 0.1);
}

/* Touch-optimierte Höhe */
@media (pointer: coarse) {
    .suggestions-dropdown li {
        padding: 16px;
        min-height: 52px;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .suggestions-dropdown {
        background: var(--surface-strong);
        border-color: var(--primary-orange);
    }

    .suggestions-dropdown li {
        border-color: var(--border-strong);
    }

    .suggestions-dropdown li:hover,
    .suggestions-dropdown li.highlighted {
        background: var(--surface-soft);
    }
}

/* ===========================
   Ingredients & Chips
   =========================== */
/* Ingredient Tags */
.ingredients-display {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    min-height: 40px;
}

.ingredient-chip {
    background: linear-gradient(135deg, var(--primary-green), #66BB6A);
    color: white;
    padding: 8px 16px;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease-out;
}

.ingredient-chip .remove-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.ingredient-chip .remove-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.empty-state {
    text-align: center;
    color: var(--gray-text);
    padding: 20px;
    font-style: italic;
}

.portion-control {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius-small);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portion-control:focus-within {
    border-color: var(--primary-orange);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.16);
}

.portion-btn {
    background: var(--light-gray);
    color: var(--dark-text);
    border: none;
    width: 38px;
    height: 42px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.portion-btn:hover {
    background: #d6d8de;
    color: var(--primary-orange);
}

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

.portion-control input {
    width: 72px;
    padding: 10px;
    border: none;
    font-size: 1rem;
    text-align: center;
    outline: none;
    background: transparent;
    color: var(--dark-text);
}

.portion-control input[type="number"]::-webkit-inner-spin-button,
.portion-control input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.portion-control input[type="number"] {
    -moz-appearance: textfield;
}

/* ===========================
   Recipes & Details
   =========================== */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 12px;
}


/* Recipe Cards */
.recipe-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.recipe-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.recipe-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.recipe-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-text);
    flex: 1;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s;
    color: var(--light-gray);
}

.favorite-btn.active {
    color: var(--error-red);
    animation: heartBeat 0.5s;
}

.recipe-card-meta {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--gray-text);
    margin-top: 12px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.difficulty-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.difficulty-easy {
    background: #C8E6C9;
    color: #2E7D32;
}

.difficulty-medium {
    background: #FFE0B2;
    color: #E65100;
}

.difficulty-hard {
    background: #FFCDD2;
    color: #C62828;
}

/* Recipe Detail */
.recipe-detail {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.recipe-detail-header {
    margin-bottom: 24px;
}

.recipe-detail-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 12px;
}

.recipe-image-placeholder {
    width: 100%;
    height: 200px;
    background: var(--primary-gradient);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    margin-bottom: 20px;
}

.recipe-detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.recipe-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recipe-primary-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.recipe-secondary-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

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

.recipe-section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-orange);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ingredient-list {
    list-style: none;
    padding: 0;
}

.ingredient-list li {
    padding: 10px;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ingredient-list li:before {
    content: "✓";
    color: var(--primary-green);
    font-weight: bold;
    font-size: 1.2rem;
}

.instruction-list {
    list-style: none;
    counter-reset: step-counter;
    padding: 0;
}

.instruction-list li {
    counter-increment: step-counter;
    padding: 16px;
    margin-bottom: 12px;
    background: var(--surface-soft);
    border-radius: var(--border-radius-small);
    position: relative;
    padding-left: 50px;
}

.instruction-list li:before {
    content: counter(step-counter);
    position: absolute;
    left: 16px;
    top: 16px;
    background: var(--primary-gradient);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.allergen-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.allergen-tag {
    background: #FFE0E0;
    color: #C62828;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ===========================
   Cook Mode Overlay
   =========================== */
.cook-mode {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 9999;
}

.cook-mode .cook-mode-content {
    background: #0D0D0D;
    color: #F5F5F5;
    width: min(800px, 100%);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cook-mode.hidden {
    display: none;
}

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

.cook-mode-label {
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-yellow);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.cook-mode-title {
    font-size: 1.6rem;
    margin: 0;
}

.cook-mode-body {
    background: #161616;
    border-radius: 14px;
    padding: 24px;
    height: 280px; /* Fixe Höhe statt min-height */
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow-y: auto; /* Scrollbar bei langen Texten */
}

.cook-mode-counter {
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.cook-mode-step {
    font-size: 1.5rem;
    line-height: 1.6;
    font-weight: 600;
    flex: 1; /* Nimmt verfügbaren Platz */
    display: flex;
    align-items: center; /* Vertikale Zentrierung */
}

.cook-mode-navigation {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.cook-mode-nav-btn {
    background: var(--white);
    color: var(--primary-orange);
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    min-width: 56px;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.cook-mode-nav-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.cook-mode-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.icon-button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #F5F5F5;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    display: grid;
    place-items: center;
}

.recipe-actions .btn + .btn {
    margin-top: 0;
}

/* ===========================
   Profile & Settings
   =========================== */
/* Profile/Settings */
.profile-header {
    background: var(--primary-gradient);
    color: white;
    padding: 24px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    text-align: center;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.profile-email {
    opacity: 0.9;
    font-size: 0.9rem;
}

.settings-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.balance-card {
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius-small);
    padding: 10px 12px;
    background: var(--white);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.balance-card.premium {
    border-color: rgba(217, 119, 6, 0.2);
    background: var(--surface-soft);
}

.balance-card-content {
    flex: 1;
}

.balance-card-icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    margin-left: 12px;
    opacity: 0.85;
}

.balance-card-label {
    font-weight: 600;
    color: var(--gray-text);
    margin-bottom: 4px;
}

.balance-card-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-text);
}

.balance-card-hint {
    color: var(--gray-text);
    font-size: 0.85rem;
    margin-top: 4px;
}

.purchase-actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.purchase-disclaimer {
    font-size: 0.9rem;
    color: var(--gray-text);
}

.purchase-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.purchase-buttons .btn {
    flex: 1;
    min-width: 140px;
}

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

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

.settings-item-label {
    font-weight: 600;
    color: var(--dark-text);
}

.settings-item-value {
    color: var(--gray-text);
    font-size: 0.9rem;
}

.settings-arrow {
    color: var(--light-gray);
}

/* Multi-select */
.multi-select {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.select-chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--light-gray);
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.select-chip.selected {
    background: var(--primary-orange);
    color: white;
    border-color: var(--primary-orange);
}

.chip-code {
    font-weight: 700;
    margin-right: 6px;
}

/* ===========================
   Feedback & Overlay States
   =========================== */
/* Loading States */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

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

.loading-text {
    color: var(--gray-text);
    font-weight: 500;
}

/* Error/Success Messages */
.message {
    padding: 16px;
    border-radius: var(--border-radius-small);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s;
}

.message-error {
    background: #FFEBEE;
    color: var(--error-red);
    border-left: 4px solid var(--error-red);
}

.message-success {
    background: #E8F5E9;
    color: var(--success-green);
    border-left: 4px solid var(--success-green);
}

.message-close {
    margin-left: auto;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: inherit;
}

.message-close:hover {
    opacity: 0.7;
}

.hidden {
    display: none !important;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark-text);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-text);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.close-btn:hover {
    background: var(--light-gray);
}

.modal-disclaimer {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--gray-text);
    background: var(--surface-muted);
    border-left: 4px solid var(--primary-orange);
    padding: 10px 12px;
    border-radius: var(--border-radius-small);
}

/* ===========================
   Motion & Media Queries
   =========================== */
/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        max-width: 100%;
    }

    .screen {
        padding: 16px;
    }

    .search-wrapper {
        flex-direction: column;
    }

    .recipe-detail-meta {
        flex-direction: column;
        gap: 12px;
    }
}

/* PWA Standalone Mode */
@media (display-mode: standalone) {
    body {
        user-select: none;
    }

    .app-header {
        padding-top: max(16px, env(safe-area-inset-top));
    }

    .bottom-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-cream: #0F1115;
        --white: #1B1F27;
        --dark-text: #F5F6F8;
        --gray-text: #B0B5BD;
        --light-gray: #2A2F38;
        --surface-strong: #1B1F27;
        --surface-soft: #151922;
        --surface-muted: #1F242D;
        --border-strong: #2E3542;
        --border-muted: rgba(255, 255, 255, 0.08);
        --primary-gradient: linear-gradient(135deg, #7F1D1D, #9A3412);
    }

    body {
        background: var(--light-cream);
        color: var(--dark-text);
    }

    .app-header {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    }

    .offline-banner {
        background: #191D24;
        border-bottom-color: rgba(251, 191, 36, 0.18);
    }

    .offline-text p {
        color: var(--dark-text);
    }

    .search-container,
    .filter-panel,
    .recipes-filter-bar,
    .recipe-card,
    .recipe-detail,
    .settings-section,
    .balance-card,
    .select-chip,
    .modal-content,
    .pwa-popup-content,
    .admin-card {
        background: var(--surface-strong);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    }

    .filter-section {
        border-bottom-color: var(--border-strong);
    }

    .filter-section-icon {
        background: var(--surface-soft);
    }

    .filter-icon-btn {
        background: var(--surface-soft);
        color: var(--gray-text);
    }

    .filter-icon-btn.active {
        background: rgba(220, 38, 38, 0.2);
        border-color: rgba(220, 38, 38, 0.35);
    }

    .option-chip {
        background: var(--surface-soft);
        border-color: var(--border-strong);
        color: var(--gray-text);
    }

    .option-chip:hover {
        background: var(--surface-strong);
    }

    .quick-chip {
        background: var(--surface-soft);
        border-color: var(--border-strong);
        color: var(--dark-text);
    }

    .quick-chip:hover {
        background: rgba(76, 175, 80, 0.16);
    }

    .toggle-slider {
        background-color: var(--border-strong);
    }

    .toggle-slider:before {
        background-color: var(--surface-strong);
    }

    .search-input {
        background: var(--surface-soft);
        color: var(--dark-text);
    }

    .search-input,
    .portion-control {
        border-color: var(--border-strong);
    }

    .portion-control input {
        color: var(--dark-text);
    }

    .portion-btn {
        background: var(--border-strong);
        color: var(--dark-text);
    }

    .portion-btn:hover {
        background: #3A4150;
        color: var(--primary-orange);
    }

    .btn-outline {
        background: transparent;
        color: var(--primary-orange);
    }

    .btn-ghost {
        background: var(--surface-muted);
        color: var(--dark-text);
        border-color: var(--border-strong);
    }

    .suggestions-dropdown {
        background: var(--surface-strong);
        border-color: var(--primary-orange);
    }

    .suggestions-dropdown li {
        border-color: var(--border-strong);
    }

    .suggestions-dropdown li:hover,
    .suggestions-dropdown li.highlighted {
        background: var(--surface-soft);
    }

    .ingredient-list li {
        border-bottom-color: var(--border-strong);
    }

    .instruction-list li {
        background: var(--surface-soft);
    }

    .balance-card.premium {
        background: rgba(217, 119, 6, 0.12);
    }

    .settings-item {
        border-bottom-color: var(--border-strong);
    }

    .settings-arrow {
        color: var(--border-strong);
    }

    .select-chip {
        border-color: var(--border-strong);
    }

    .modal-disclaimer {
        background: rgba(217, 119, 6, 0.12);
    }

    .admin-table-btn {
        background: var(--surface-soft);
        border-color: var(--border-strong);
        color: var(--dark-text);
    }

    .admin-table-btn:hover {
        background: var(--surface-muted);
    }
}

/* ===========================
   PWA Install Popup
   =========================== */
.pwa-install-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: opacity 0.3s, transform 0.3s;
    padding: 0;
}

.pwa-install-popup.hidden {
    display: none;
    opacity: 0;
    transform: translateY(100%);
}

.pwa-popup-content {
    background: var(--white);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 24px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pwa-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: var(--gray-text);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 50%;
}

.pwa-popup-close:hover {
    background: var(--light-gray);
    color: var(--dark-text);
}

.pwa-popup-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 12px;
}

.pwa-popup-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-orange);
    margin-bottom: 12px;
    text-align: center;
}

.pwa-popup-text {
    color: var(--gray-text);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.pwa-popup-actions {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.pwa-popup-actions .btn {
    width: 100%;
    justify-content: center;
}

/* Dark mode support for PWA popup */
@media (prefers-color-scheme: dark) {
    .pwa-popup-content {
        background: var(--surface-strong);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    }

    .pwa-popup-title {
        color: var(--accent-yellow);
    }

    .pwa-popup-text {
        color: var(--gray-text);
    }
}

/* Responsive adjustments for smaller screens */
@media (max-width: 480px) {
    .pwa-popup-content {
        padding: 20px 16px;
    }

    .pwa-popup-title {
        font-size: 1.3rem;
    }

    .pwa-popup-text {
        font-size: 0.9rem;
    }
}

/* ===========================
   Auth & Account Modals
   =========================== */
/* ========== AUTH STYLES ========== */

/* Form Groups */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-text);
    font-size: 0.9rem;
}

/* Auth Messages */
.auth-error, .auth-success {
    padding: 12px 16px;
    border-radius: var(--border-radius-small);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.auth-error {
    background: #FFE5E5;
    color: var(--error-red);
    border: 1px solid var(--error-red);
}

.auth-success {
    background: #E8F5E9;
    color: var(--success-green);
    border: 1px solid var(--success-green);
}

/* Auth Switch Link */
.auth-switch {
    color: var(--gray-text);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--primary-orange);
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
}

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

/* Text Secondary */
.text-secondary {
    color: var(--gray-text);
}

/* Quick-Add Inline Section */
.quick-add-inline {
    background: var(--light-cream);
    border: 1px dashed var(--light-gray);
    border-radius: var(--border-radius-small);
    padding: 12px;
    margin-bottom: 16px;
}

.quick-add-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.quick-add-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-add-label i {
    font-size: 1rem;
    color: var(--primary-orange);
}

.quick-add-toggle {
    background: none;
    border: none;
    color: var(--gray-text);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.quick-add-toggle.expanded i {
    transform: rotate(180deg);
}

/* Kompaktere Chips */
.quick-add-inline .quick-add-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-chip {
    background: var(--white);
    border: 1px solid var(--light-gray);
    color: var(--dark-text);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.quick-chip:hover {
    border-color: var(--primary-green);
    background: rgba(76, 175, 80, 0.08);
    color: var(--primary-green);
}

.quick-chip:active {
    transform: scale(0.95);
}

/* Empty State */
.quick-add-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    color: var(--gray-text);
    font-size: 0.85rem;
}

.quick-add-empty i {
    color: var(--accent-yellow);
    font-size: 1rem;
}

.quick-add-empty.hidden {
    display: none;
}

/* Collapsed State - nur 1 Zeile zeigen */
.quick-add-inline.collapsed .quick-add-chips {
    max-height: 36px;
    overflow: hidden;
}

/* Quick-Add Toggle Animation */
.quick-add-toggle i {
    transition: transform 0.25s ease;
}

.quick-add-toggle.expanded i {
    transform: rotate(180deg);
}

/* Collapsed State mit Smooth Transition */
.quick-add-inline .quick-add-chips {
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.quick-add-inline.collapsed .quick-add-chips {
    max-height: 40px; /* Eine Zeile Chips */
}

.quick-add-inline:not(.collapsed) .quick-add-chips {
    max-height: 500px; /* Genug Platz für alle Chips */
}

/* Fade-Effekt für abgeschnittene Chips */
.quick-add-inline.collapsed .quick-add-chips::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 100%;
    background: linear-gradient(to right, transparent, var(--light-cream));
    pointer-events: none;
}

.quick-add-inline .quick-add-chips {
    position: relative;
}

/* ===========================
   Admin Page Styles
=========================== */

.admin-page {
    background: var(--light-cream);
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.admin-subtitle {
    margin: 0;
    color: var(--gray-text);
    font-size: 0.9rem;
}

.admin-main {
    padding: 20px;
}

.admin-card {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.admin-card h2,
.admin-card h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.admin-help {
    color: var(--gray-text);
    margin-bottom: 16px;
}

.admin-form {
    display: grid;
    gap: 12px;
}

.admin-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.admin-input {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--light-gray);
    font-size: 1rem;
}

.admin-input[readonly] {
    background: var(--light-cream);
}

.admin-error {
    color: #b91c1c;
    margin-top: 12px;
    font-weight: 600;
}

.admin-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 20px;
}

.admin-list {
    height: fit-content;
}

.admin-table-list {
    display: grid;
    gap: 8px;
}

.admin-table-btn {
    border: 1px solid var(--light-gray);
    background: var(--light-cream);
    padding: 10px 12px;
    border-radius: 10px;
    text-align: left;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
}

.admin-table-btn:hover {
    background: var(--surface-muted);
    transform: translateY(-1px);
}

.admin-view-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-pagination {
    display: flex;
    gap: 8px;
}

.admin-table-container {
    overflow-x: auto;
}

.admin-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-data-table th,
.admin-data-table td {
    border-bottom: 1px solid var(--light-gray);
    padding: 10px 12px;
    vertical-align: top;
    text-align: left;
}

.admin-data-table th {
    background: var(--light-cream);
    position: sticky;
    top: 0;
    z-index: 1;
}

.admin-data-table td pre {
    margin: 0;
    white-space: pre-wrap;
    font-size: 0.8rem;
    line-height: 1.2rem;
}

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-pagination {
        width: 100%;
        justify-content: flex-end;
    }
}
