/* Chef’s Tab Styling System - Android Material You inspired */

:root {
    /* Color tokens - Mint / Forest Green Theme */
    --primary: HSL(142, 70%, 42%);
    --primary-hover: HSL(142, 70%, 36%);
    --primary-container: HSL(142, 70%, 94%);
    --on-primary: #ffffff;
    --on-primary-container: HSL(142, 80%, 12%);
    
    --secondary: HSL(160, 40%, 40%);
    --secondary-container: HSL(160, 40%, 93%);
    --on-secondary: #ffffff;
    --on-secondary-container: HSL(160, 50%, 10%);
    
    --background: HSL(142, 25%, 97%);
    --surface: #ffffff;
    --surface-variant: HSL(142, 15%, 93%);
    --on-background: HSL(142, 35%, 12%);
    --on-surface: HSL(142, 30%, 12%);
    --on-surface-variant: HSL(142, 15%, 35%);
    
    --outline: HSL(142, 10%, 85%);
    --outline-focus: var(--primary);
    
    --error: HSL(0, 75%, 45%);
    --error-container: HSL(0, 85%, 95%);
    --on-error-container: HSL(0, 85%, 15%);
    
    --shadow: rgba(16, 185, 129, 0.06);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.03), 0 2px 6px rgba(0, 0, 0, 0.02);
    --app-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    
    --border-radius-s: 8px;
    --border-radius-m: 16px;
    --border-radius-l: 24px;
    --border-radius-xl: 32px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Dark mode overrides */
body.dark-mode {
    --primary: HSL(142, 70%, 48%);
    --primary-hover: HSL(142, 70%, 55%);
    --primary-container: HSL(142, 40%, 15%);
    --on-primary: #0b1a13;
    --on-primary-container: HSL(142, 80%, 85%);
    
    --secondary: HSL(160, 45%, 45%);
    --secondary-container: HSL(160, 40%, 14%);
    --on-secondary: #0a1914;
    --on-secondary-container: HSL(160, 50%, 85%);
    
    --background: HSL(142, 20%, 6%);
    --surface: HSL(142, 15%, 11%);
    --surface-variant: HSL(142, 12%, 16%);
    --on-background: HSL(142, 15%, 90%);
    --on-surface: HSL(142, 15%, 90%);
    --on-surface-variant: HSL(142, 10%, 70%);
    
    --outline: HSL(142, 10%, 22%);
    --shadow: rgba(0, 0, 0, 0.2);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.15);
    --app-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    background-color: #f1f5f9;
    font-family: var(--font-sans);
    color: var(--on-background);
    transition: background-color 0.3s ease;
    overflow: hidden;
}

/* Phone Mockup Wrapper for Desktop preview */
.app-container {
    width: 100%;
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--background);
    box-shadow: none;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

@media (min-width: 481px) {
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        background-image: radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0) 90%);
    }
    .app-container {
        height: 850px;
        border-radius: var(--border-radius-xl);
        border: 8px solid #27272a; /* Device bezel */
        box-shadow: var(--app-shadow);
    }
}

/* App Bar (Header) */
.app-bar {
    height: 64px;
    min-height: 64px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--surface);
    border-bottom: 1px solid var(--outline);
    z-index: 10;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.app-title-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    color: var(--primary);
    font-size: 28px;
    animation: rotateLogo 20s linear infinite;
}

#app-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--on-surface);
    letter-spacing: -0.5px;
}

/* Icon Buttons */
.icon-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--on-surface-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.icon-button:hover {
    background-color: var(--surface-variant);
    color: var(--on-surface);
}

.icon-button:active {
    transform: scale(0.92);
}

.hidden {
    display: none !important;
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    position: relative;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.content-area::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

/* Views transition */
.app-view {
    width: 100%;
}

#view-settings {
    width: 100%;
    padding-bottom: 60px;
}

/* Cards style */
.card {
    background-color: var(--surface);
    border-radius: var(--border-radius-m);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--outline);
    transition: var(--transition);
}

.hero-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, var(--surface) 100%);
    border: 2px solid var(--primary);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.12);
}

.hero-card h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--on-surface);
    margin-bottom: 8px;
}

.hero-card p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--on-surface);
    opacity: 0.85;
    margin-bottom: 16px;
}

/* Form Styles */
.import-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--on-surface-variant);
}

.import-form input {
    width: 100%;
    height: 52px;
    padding: 12px 12px 12px 44px;
    border-radius: var(--border-radius-m);
    border: 1px solid var(--outline);
    background-color: var(--surface);
    color: var(--on-surface);
    font-family: var(--font-sans);
    font-size: 15px;
    transition: var(--transition);
}

.import-form input:focus {
    outline: none;
    border-color: var(--outline-focus);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Button style */
.btn {
    height: 52px;
    border-radius: var(--border-radius-m);
    border: none;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
    position: relative;
}

.btn-primary {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}

.btn-primary *,
#btn-import,
#btn-import *,
.btn-import-discovery,
.btn-import-discovery *,
.btn-import-deal-recipe,
.btn-import-deal-recipe * {
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

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

.btn-secondary {
    background-color: var(--secondary-container);
    color: var(--on-secondary-container);
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.btn-secondary:hover {
    background-color: var(--outline);
}

.btn-text {
    background: transparent;
    color: var(--primary);
    padding: 0 16px;
}

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

.btn-small {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: var(--border-radius-s);
}

/* Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

.btn-primary .spinner {
    position: absolute;
}

/* Error Banner */
.error-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--error-container);
    color: var(--on-error-container);
    padding: 12px;
    border-radius: var(--border-radius-m);
    margin-top: 12px;
    font-size: 13px;
    border: 1px solid rgba(239, 68, 68, 0.1);
    animation: shake 0.3s ease-in-out;
}

/* Recipes Section & List */
.recipes-section {
    margin-top: 24px;
}

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

.section-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--on-surface);
}

.recipe-count {
    font-size: 13px;
    color: var(--on-surface-variant);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--on-surface-variant);
}

.empty-icon {
    font-size: 48px;
    color: var(--outline);
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.5;
    max-width: 240px;
}

/* Saved Recipes Grid */
.recipes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    animation: fadeIn 0.4s ease;
}

.recipe-card {
    background-color: var(--surface);
    border-radius: var(--border-radius-m);
    border: 1px solid var(--outline);
    box-shadow: var(--card-shadow);
    display: flex;
    height: 96px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.recipe-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.1);
}

.recipe-card-img {
    width: 96px;
    height: 96px;
    background-size: cover;
    background-position: center;
    background-color: var(--surface-variant);
    position: relative;
}

.recipe-card-img::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0) 50%);
}

.recipe-card-info {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0; /* allows text truncation */
}

.recipe-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--on-surface);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.recipe-card-host {
    font-size: 12px;
    color: var(--on-surface-variant);
    margin-bottom: 6px;
}

.recipe-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
}

.recipe-card-meta span {
    font-size: 14px;
}

.btn-delete-recipe {
    position: absolute;
    right: 8px;
    top: 8px;
    background-color: var(--surface);
    border: 1px solid var(--outline);
    opacity: 0.6;
    width: 28px;
    height: 28px;
    z-index: 2;
}

.btn-delete-recipe:hover {
    opacity: 1;
    background-color: var(--error-container);
    color: var(--error);
    border-color: var(--error);
}

/* View 2: Recipe Detail Styles */
.recipe-hero-container {
    height: 180px;
    border-radius: var(--border-radius-m);
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--card-shadow);
}

.recipe-hero-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: var(--surface-variant);
}

.recipe-hero-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0) 100%);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recipe-badge {
    background-color: var(--primary);
    color: var(--on-primary);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.recipe-title {
    font-size: 20px;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    line-height: 1.2;
}

.recipe-source-link {
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    align-self: flex-start;
    transition: var(--transition);
}

.recipe-source-link:hover {
    color: white;
    text-decoration: underline;
}

.recipe-source-link span {
    font-size: 14px;
}

.recipe-meta-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.meta-card {
    background-color: var(--surface);
    border-radius: var(--border-radius-m);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--outline);
    box-shadow: var(--card-shadow);
}

.meta-card span {
    font-size: 24px;
    color: var(--primary);
}

.meta-info {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 11px;
    color: var(--on-surface-variant);
}

.meta-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--on-surface);
}

/* Controls / Toggle switch style */
.controls-card {
    padding: 14px 20px;
    border: 1px solid var(--outline);
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.control-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-label span.material-icons-round {
    font-size: 28px;
    color: var(--primary);
}

.control-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--on-surface);
    display: block;
}

.control-desc {
    font-size: 11px;
    color: var(--on-surface-variant);
    display: block;
}

/* The switch - container */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--outline);
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: var(--surface);
  transition: .3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background-color: var(--primary);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Tabs styles */
.tabs-bar {
    display: flex;
    background-color: var(--surface-variant);
    border-radius: var(--border-radius-m);
    padding: 4px;
    margin-bottom: 16px;
    border: 1px solid var(--outline);
}

.tab-button {
    flex: 1;
    height: 40px;
    border-radius: calc(var(--border-radius-m) - 4px);
    border: none;
    background: transparent;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 14px;
    color: var(--on-surface-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.tab-button span.material-icons-round {
    font-size: 18px;
}

.tab-button.active {
    background-color: var(--surface);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

/* Ingredients List */
.list-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 4px;
}

.list-summary {
    font-size: 13px;
    font-weight: 500;
    color: var(--on-surface-variant);
}

.ingredients-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ingredient-item {
    background-color: var(--surface);
    border-radius: var(--border-radius-m);
    border: 1px solid var(--outline);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.ingredient-checkbox-wrapper {
    height: 20px;
    display: flex;
    align-items: center;
}

.ingredient-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--on-surface);
    font-weight: 500;
    transition: var(--transition);
}

.ingredient-item.checked {
    opacity: 0.55;
    background-color: var(--background);
}

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

/* Checkbox design */
.checkbox-container {
    display: block;
    position: relative;
    width: 20px;
    height: 20px;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0; width: 0;
}

.checkmark {
    position: absolute;
    top: 0; left: 0;
    height: 20px; width: 20px;
    background-color: var(--surface);
    border: 2px solid var(--on-surface-variant);
    border-radius: 6px;
    transition: var(--transition);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px; top: 2px;
    width: 4px; height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

/* Instructions Step-by-Step List */
.instructions-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.instruction-item {
    background-color: var(--surface);
    border-radius: var(--border-radius-m);
    border: 1px solid var(--outline);
    padding: 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.instruction-item:hover {
    border-color: var(--primary);
}

.instruction-item.completed {
    opacity: 0.5;
    border-color: var(--outline);
}

.instruction-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15), var(--card-shadow);
}

.step-num {
    background-color: var(--surface-variant);
    color: var(--on-surface-variant);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 8px;
    transition: var(--transition);
}

.instruction-item.active .step-num {
    background-color: var(--primary);
    color: var(--on-primary);
}

.step-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--on-surface);
}

.btn-inline-timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--primary-container);
    color: var(--on-primary-container);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-inline-timer:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
}

.btn-inline-timer span.material-icons-round {
    font-size: 14px;
}

/* Floating Action Button (FAB) */
.fab {
    position: absolute;
    bottom: 24px;
    right: 24px;
    height: 56px;
    border-radius: 28px;
    background-color: var(--primary);
    color: var(--on-primary);
    border: none;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    gap: 8px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    z-index: 5;
    transition: var(--transition);
}

.fab:hover {
    background-color: var(--primary-hover);
    transform: scale(1.04) translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.fab:active {
    transform: scale(0.96) translateY(0);
}

/* Cook Mode Full-Screen view */
.cook-mode-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--background);
    z-index: 100;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cook-mode-header {
    height: 64px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--outline);
    background-color: var(--surface);
}

.cook-progress-title {
    font-weight: 800;
    font-size: 18px;
    color: var(--on-surface);
}

.cook-step-indicator {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background-color: var(--primary-container);
    padding: 4px 10px;
    border-radius: 12px;
}

.cook-mode-body {
    flex: 1;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.cook-step-card {
    background-color: var(--surface);
    border-radius: var(--border-radius-l);
    border: 1px solid var(--outline);
    padding: 24px 20px;
    box-shadow: var(--card-shadow);
    min-height: 180px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: auto 0;
}

.cook-step-content {
    font-size: 19px;
    line-height: 1.6;
    font-weight: 500;
    color: var(--on-surface);
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
}

@media (max-height: 650px) {
    .cook-step-card {
        padding: 16px 14px;
        min-height: 140px;
    }
    .cook-step-content {
        font-size: 16px;
        line-height: 1.5;
    }
}

.cook-timer-card {
    background-color: var(--surface);
    border-radius: var(--border-radius-m);
    border: 1px solid var(--outline);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: var(--card-shadow);
}

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

.timer-icon {
    font-size: 32px;
    color: var(--primary);
}

.timer-time {
    font-size: 36px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--on-surface);
    letter-spacing: -1px;
}

.timer-controls {
    display: flex;
    gap: 12px;
}

.cook-mode-footer {
    height: 76px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--surface);
    border-top: 1px solid var(--outline);
    gap: 12px;
}

.cook-progress-bar-container {
    flex: 1;
    height: 8px;
    background-color: var(--surface-variant);
    border-radius: 4px;
    overflow: hidden;
}

.cook-progress-bar {
    height: 100%;
    background-color: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Floating Kitchen Timer Drawer */
.timer-drawer {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background-color: var(--surface);
    border-top: 1px solid var(--outline);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    border-radius: var(--border-radius-m) var(--border-radius-m) 0 0;
    z-index: 90;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.timer-drawer-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    color: var(--on-surface);
}

.alarm-icon {
    color: var(--primary);
}

.timer-drawer-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 4px;
}

.timer-drawer-time {
    font-size: 28px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--on-surface);
}

.timer-drawer-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.primary-circle-btn {
    background-color: var(--primary);
    color: var(--on-primary);
    border: none;
}

.primary-circle-btn:hover {
    background-color: var(--primary-hover);
}

/* Keyframe animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes rotateLogo {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.pulse {
    animation: pulseKey 1.5s ease-in-out infinite;
}

@keyframes pulseKey {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Auth Screen Overlay Styling */
.auth-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--background);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.auth-card {
    background-color: var(--surface);
    border-radius: var(--border-radius-l);
    border: 1px solid var(--outline);
    padding: 24px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--app-shadow);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.auth-logo {
    color: var(--primary);
    font-size: 40px;
    margin-bottom: 4px;
    animation: rotateLogo 20s linear infinite;
}

.auth-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--on-surface);
    letter-spacing: -0.5px;
}

.auth-header p {
    font-size: 13px;
    color: var(--on-surface-variant);
    line-height: 1.4;
}

.auth-tabs {
    display: flex;
    background-color: var(--surface-variant);
    border-radius: var(--border-radius-m);
    padding: 4px;
    border: 1px solid var(--outline);
}

.auth-tab-btn {
    flex: 1;
    height: 36px;
    border-radius: calc(var(--border-radius-m) - 4px);
    border: none;
    background: transparent;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 13px;
    color: var(--on-surface-variant);
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab-btn.active {
    background-color: var(--surface);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

.auth-form input {
    width: 100%;
    height: 48px;
    padding: 12px 12px 12px 40px;
    border-radius: var(--border-radius-m);
    border: 1px solid var(--outline);
    background-color: var(--surface);
    color: var(--on-surface);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: var(--transition);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--outline-focus);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.success-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-container);
    color: var(--on-primary-container);
    padding: 12px;
    border-radius: var(--border-radius-m);
    margin-top: 12px;
    font-size: 13px;
    border: 1px solid rgba(16, 185, 129, 0.1);
    animation: fadeIn 0.3s ease;
}

/* Align App Bar logout button with theme toggle */
.app-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* User Settings Panel Styling */
.profile-settings-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
}

.profile-avatar-container {
    position: relative;
    cursor: pointer;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: var(--surface-variant);
    border: 3px solid var(--primary);
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.profile-avatar:hover {
    transform: scale(1.02);
}

.avatar-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: var(--transition);
}

.profile-avatar:hover .avatar-overlay {
    opacity: 1;
}

.profile-avatar-container::after {
    content: 'Edit';
    position: absolute;
    bottom: -4px; right: -4px;
    background-color: var(--primary);
    color: var(--on-primary);
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.profile-username {
    font-size: 18px;
    font-weight: 700;
    color: var(--on-surface);
}

.profile-status-message {
    width: 100%;
    margin-top: 8px;
}

.select-dropdown {
    padding: 8px 12px;
    border-radius: var(--border-radius-s);
    border: 1px solid var(--outline);
    background-color: var(--surface);
    color: var(--on-surface);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.select-dropdown:focus {
    outline: none;
    border-color: var(--primary);
}

/* Allergen Alert Styling */
.allergen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.allergen-alert-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: HSL(4, 90%, 95%);
    border: 1.5px solid HSL(4, 80%, 75%);
    border-radius: var(--border-radius-m);
    padding: 16px;
    margin-bottom: 20px;
    color: HSL(4, 85%, 35%);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.08);
    animation: fadeIn 0.3s ease-out;
}

.dark-mode .allergen-alert-banner {
    background-color: HSL(4, 30%, 15%);
    border-color: HSL(4, 50%, 40%);
    color: HSL(4, 90%, 80%);
}

.alert-banner-icon {
    font-size: 28px;
    color: HSL(4, 80%, 50%);
}

.alert-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    line-height: 1.4;
}

.alert-banner-text strong {
    font-size: 14px;
    font-weight: 800;
}

.ingredient-item.allergen-warning {
    background-color: HSL(4, 95%, 96%) !important;
    border: 1px dashed HSL(4, 70%, 80%) !important;
    border-radius: var(--border-radius-s);
    padding-left: 8px;
}

.dark-mode .ingredient-item.allergen-warning {
    background-color: HSL(4, 30%, 13%) !important;
    border-color: HSL(4, 50%, 35%) !important;
}

.ingredient-item.allergen-warning .ingredient-text {
    color: HSL(4, 85%, 35%) !important;
    font-weight: 600;
}

.dark-mode .ingredient-item.allergen-warning .ingredient-text {
    color: HSL(4, 90%, 80%) !important;
}

.ingredient-item.allergen-warning::after {
    content: '⚠️ Contains Allergen';
    font-size: 10px;
    font-weight: 700;
    color: HSL(4, 80%, 50%);
    background-color: HSL(4, 90%, 90%);
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: auto;
}

.dark-mode .ingredient-item.allergen-warning::after {
    background-color: HSL(4, 45%, 25%);
    color: HSL(4, 90%, 85%);
}

/* Servings Stepper Layout */
.servings-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.stepper-btn {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition);
    border-radius: 50%;
}

.stepper-btn:hover {
    color: var(--primary-container);
    background-color: rgba(16, 185, 129, 0.08);
}

.stepper-btn span {
    font-size: 20px;
}

.servings-val {
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

/* Allergen Label Alignments */
.allergen-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.allergen-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--on-surface-variant);
    user-select: none;
    transition: var(--transition);
}

.allergen-item:hover .allergen-label {
    color: var(--on-surface);
}

/* Shared Recipe Banner styling */
.shared-recipe-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--primary);
    color: white;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: var(--border-radius-m);
    font-size: 13px;
    box-shadow: var(--shadow-s);
}

/* Drawer Overlay (backdrop) */
.drawer-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    align-items: flex-end;
}

.drawer-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

/* Bottom Share Drawer */
.share-drawer {
    width: 100%;
    background-color: var(--surface);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-l);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-overlay:not(.hidden) .share-drawer {
    transform: translateY(0);
}

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

.drawer-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--on-surface);
    margin: 0;
}

/* Tags Filter Bar */
.tag-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.tag-filter-bar::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.filter-pill {
    background-color: var(--surface);
    color: var(--on-surface-variant);
    border: 1px solid var(--outline);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-pill:hover {
    background-color: var(--surface-variant);
    color: var(--on-surface);
}

.filter-pill.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Center manual recipe card modal animations */
#manual-recipe-overlay:not(.hidden) .manual-recipe-card {
    transform: scale(1);
    opacity: 1;
}

.manual-recipe-card {
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

/* Custom Recipe Tag pills */
.recipe-tag-pill {
    background-color: var(--primary-container);
    color: var(--on-primary-container);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-remove-tag {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: var(--on-primary-container);
    opacity: 0.7;
    transition: opacity 0.2s;
}

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

/* Custom Tags Filter Dropdown styles */
.tags-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--on-surface);
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.tags-dropdown-item:hover {
    background-color: var(--surface-variant);
}

.tags-dropdown-item input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    margin: 0;
}

/* Bring!-Style Shopping List Grid & Tiles */
.bring-category-section {
    margin-bottom: 20px;
}

.bring-category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--on-surface-variant);
    margin-bottom: 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--outline);
}

.bring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 10px;
}

.bring-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 6px;
    border-radius: var(--border-radius-m);
    background-color: var(--surface);
    border: 1px solid var(--outline);
    box-shadow: var(--shadow-s);
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease, opacity 0.2s ease;
    text-align: center;
    min-height: 90px;
}

.bring-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-m);
    border-color: var(--primary);
}

.bring-tile:active {
    transform: scale(0.95);
}

.bring-tile.checked {
    background-color: var(--surface-variant);
    opacity: 0.55;
    border-color: transparent;
    box-shadow: none;
}

.bring-tile-icon {
    font-size: 28px;
    margin-bottom: 4px;
    transition: transform 0.2s ease;
}

.bring-tile.checked .bring-tile-icon {
    transform: scale(0.85);
    filter: grayscale(80%);
}

.bring-tile-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--on-surface);
    line-height: 1.25;
    word-break: break-word;
}

.bring-tile.checked .bring-tile-label {
    text-decoration: line-through;
    color: var(--on-surface-variant);
}

.bring-tile-check-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    color: var(--primary);
    font-size: 16px;
}

/* Pull to Refresh Styles */
html, body {
    overscroll-behavior-y: auto;
}

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

.spin-anim {
    animation: spin-refresh 0.8s linear infinite !important;
}
