:root {
  --bg: #f8fafc; --bg-card: #ffffff; --bg-soft: #f1f5f9; --border: #e2e8f0;
  --accent: #0ea5e9; --accent-soft: rgba(14, 165, 233, 0.15); --accent-strong: #0284c7;
  --text: #1e293b; --text-muted: #64748b;
  --danger: #ef4444; --success: #22c55e; --warning: #f59e0b; --info: #3b82f6;
  --radius: 14px; --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08); --shadow-strong: 0 10px 40px rgba(0, 0, 0, 0.12);
  --space: 1.2rem; --transition: 0.18s ease-out;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}
[data-theme="dark"] {
  --bg: #0f172a; --bg-card: #1e293b; --bg-soft: #334155; --border: #475569;
  --accent: #38bdf8; --accent-soft: rgba(56, 189, 248, 0.15); --accent-strong: #0ea5e9;
  --text: #f8fafc; --text-muted: #94a3b8;
  --danger: #f87171; --success: #4ade80; --warning: #fbbf24; --info: #60a5fa;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.4); --shadow-strong: 0 10px 40px rgba(0, 0, 0, 0.6);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; color: var(--text); background: var(--bg); font-family: var(--font); transition: background-color 0.3s, color 0.3s; }
body { display: flex; flex-direction: column; }

/* Theme Toggle */
.theme-toggle { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 20px; cursor: pointer; transition: all 0.2s; }
.theme-toggle:hover { background: var(--accent-soft); border-color: var(--accent); }
.theme-toggle-icon { font-size: 1.1rem; transition: transform 0.3s; }
.theme-toggle:hover .theme-toggle-icon { transform: rotate(15deg); }
.theme-toggle-label { font-size: 0.8rem; color: var(--text-muted); }
@media (max-width: 600px) { .theme-toggle-label { display: none; } }

/* Voice Search */
.search-input-wrapper { position: relative; display: flex; align-items: center; }
.voice-search-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 1.2rem; padding: 5px; border-radius: 50%; transition: all 0.2s; }
.voice-search-btn:hover { background: var(--accent-soft); }
.voice-search-btn.listening { animation: pulse-mic 1s infinite; }
.voice-search-btn .mic-listening { color: var(--danger); }
@keyframes pulse-mic { 0%, 100% { transform: translateY(-50%) scale(1); } 50% { transform: translateY(-50%) scale(1.2); } }
.voice-status { position: absolute; top: calc(100% + 5px); left: 0; right: 0; padding: 8px 12px; background: var(--accent); color: white; border-radius: 8px; font-size: 0.85rem; text-align: center; animation: fadeIn 0.2s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* Keyboard Shortcuts */
.shortcuts-list { display: flex; flex-direction: column; gap: 12px; margin-top: 15px; }
.shortcut-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.shortcut-item:last-child { border-bottom: none; }
.shortcut-item kbd { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 5px; padding: 4px 8px; font-family: monospace; font-size: 0.85rem; margin-right: 5px; }
.shortcut-item span { color: var(--text-muted); }

/* Badge Count */
.badge-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; background: var(--danger); color: white; font-size: 0.7rem; font-weight: 600; border-radius: 9px; margin-left: 5px; }

/* Toast Notifications */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; max-width: 380px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-radius: 12px; background: var(--bg-card); backdrop-filter: blur(20px); border: 1px solid var(--border); box-shadow: var(--shadow-strong); pointer-events: all; animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.toast.hiding { animation: toastSlideOut 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes toastSlideIn { from { opacity: 0; transform: translateX(100%) scale(0.9); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastSlideOut { from { opacity: 1; transform: translateX(0) scale(1); } to { opacity: 0; transform: translateX(100%) scale(0.9); } }
.toast-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }
.toast-content { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 3px; }
.toast-message { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; font-size: 1.1rem; opacity: 0.7; }
.toast-close:hover { opacity: 1; }
.toast-action { margin-top: 10px; }
.toast-action .btn { padding: 6px 14px; font-size: 0.8rem; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

/* Loading */
.loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(8px); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 9998; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
.loading-overlay.active { opacity: 1; visibility: visible; }
.spinner { width: 50px; height: 50px; border: 4px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.spinner-small { width: 20px; height: 20px; border-width: 2px; display: inline-block; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { margin-top: 16px; font-size: 0.95rem; color: var(--text); }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; top: 50%; left: 50%; margin-left: -9px; margin-top: -9px; border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; }

/* Animations */
.card, .recipe-card { animation: fadeSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
.section-entering { animation: sectionEnter 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.section-leaving { animation: sectionLeave 0.2s ease forwards; }
@keyframes sectionEnter { from { opacity: 0; transform: translateY(20px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes sectionLeave { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px) scale(0.98); } }

/* Draft Indicator */
.draft-indicator { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: rgba(251, 191, 36, 0.15); border: 1px solid rgba(251, 191, 36, 0.4); border-radius: 20px; font-size: 0.75rem; color: var(--warning); margin-left: 12px; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.draft-indicator .dot { width: 6px; height: 6px; background: var(--warning); border-radius: 50%; }
.unsaved-warning { position: fixed; top: 0; left: 0; right: 0; background: linear-gradient(135deg, var(--warning), #d97706); color: #1f2937; padding: 10px 20px; text-align: center; font-size: 0.85rem; font-weight: 500; z-index: 100; display: flex; align-items: center; justify-content: center; gap: 12px; transform: translateY(-100%); transition: transform 0.3s ease; }
.unsaved-warning.visible { transform: translateY(0); }
.unsaved-warning .btn { padding: 5px 14px; font-size: 0.8rem; background: rgba(0, 0, 0, 0.2); color: inherit; }

/* Search & Suggestions */
.search-container { position: relative; flex: 1; }
.search-suggestions { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-strong); max-height: 320px; overflow-y: auto; z-index: 50; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: opacity 0.2s, transform 0.2s, visibility 0.2s; }
.search-suggestions.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.suggestion-section { padding: 8px 0; }
.suggestion-label { padding: 6px 14px; font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.suggestion-item { padding: 10px 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: background 0.15s; }
.suggestion-item:hover { background: var(--accent-soft); }
.suggestion-item .emoji { font-size: 1.1rem; }
.suggestion-item .text { flex: 1; }
.suggestion-item .text .title { font-size: 0.9rem; }
.suggestion-item .text .subtitle { font-size: 0.75rem; color: var(--text-muted); }
.suggestion-item .match { font-size: 0.7rem; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 10px; }

/* Filters */
.filters-advanced { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); margin-top: 12px; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.filter-group select, .filter-group input { min-width: 140px; padding: 8px 12px; font-size: 0.85rem; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.filter-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 20px; font-size: 0.8rem; color: var(--accent); }
.filter-tag .remove { cursor: pointer; opacity: 0.7; }
.filter-tag .remove:hover { opacity: 1; }
.filters-toggle { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: transparent; border: 1px dashed var(--border); border-radius: 8px; color: var(--text-muted); font-size: 0.8rem; cursor: pointer; transition: all 0.2s; }
.filters-toggle:hover { border-color: var(--accent); color: var(--accent); }
.filters-toggle.active { background: var(--accent-soft); border-color: var(--accent); border-style: solid; color: var(--accent); }

/* Header */
.app-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1.2rem; background: var(--bg-card); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 10px; }
.app-header h1 { font-size: 1.1rem; margin: 0; letter-spacing: 0.03em; font-weight: 600; }
.user-area { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.user-email { font-size: 0.85rem; color: var(--text-muted); }
.app-main { flex: 1; display: flex; flex-direction: column; gap: var(--space); padding: var(--space); max-width: 960px; margin: 0 auto; width: 100%; }
.app-footer { padding: 0.8rem 1.2rem 1.3rem; text-align: center; font-size: 0.8rem; color: var(--text-muted); }
.app-footer a { color: var(--accent); text-decoration: none; }

/* Cards */
.card { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); padding: var(--space); box-shadow: var(--shadow-soft); }
.auth-section { max-width: 480px; margin: 1rem auto 0; }
.controls { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.controls-left, .controls-right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.inline-label { font-size: 0.85rem; color: var(--text-muted); }

/* Buttons */
.btn { border: none; outline: none; cursor: pointer; border-radius: 999px; padding: 0.55rem 1.1rem; font-size: 0.9rem; font-weight: 500; background: linear-gradient(135deg, var(--accent-strong), var(--accent)); color: white; box-shadow: var(--shadow-soft); display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; transition: transform var(--transition), box-shadow var(--transition); }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-strong); }
.btn:active { transform: translateY(0); }
.btn.primary { width: 100%; margin-top: 0.4rem; }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); box-shadow: none; }
.btn-outline:hover { background: var(--bg-soft); color: var(--text); box-shadow: var(--shadow-soft); }
.btn-google { width: 100%; background: #fff; color: #1f2937; border: 1px solid var(--border); }
.btn-google:hover { background: #f1f5f9; }
.btn.small { padding: 0.25rem 0.7rem; font-size: 0.78rem; }
.btn-danger { background: linear-gradient(135deg, #dc2626, var(--danger)); }
.btn-warning { background: linear-gradient(135deg, #d97706, var(--warning)); color: #1f2937; }
.btn-success { background: linear-gradient(135deg, #16a34a, var(--success)); }

/* Forms */
.auth-form { display: flex; flex-direction: column; gap: 0.7rem; }
.auth-form h3 { margin: 0 0 0.2rem; font-size: 1rem; }
label { font-size: 0.85rem; display: flex; flex-direction: column; gap: 0.35rem; }
input, select, textarea { border-radius: 10px; border: 1px solid var(--border); background: var(--bg); padding: 0.55rem 0.75rem; color: var(--text); font: inherit; transition: border-color var(--transition), box-shadow var(--transition); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 90px; }
.auth-links { margin: 0.1rem 0 0; font-size: 0.8rem; }
.auth-links a { color: var(--accent); text-decoration: none; }
.divider { display: flex; align-items: center; gap: 0.5rem; margin: 1rem 0 0.7rem; color: var(--text-muted); font-size: 0.75rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.form-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.form-header-left { display: flex; align-items: center; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; margin-bottom: 0.7rem; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }

/* Steps with Photos */
.steps-container { display: flex; flex-direction: column; gap: 15px; }
.step-item { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 15px; position: relative; }
.step-item-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.step-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 1.2rem;
  padding: 5px;
  user-select: none;
  transition: color 0.2s;
}
.step-drag-handle:hover { color: var(--accent); }
.step-drag-handle:active { cursor: grabbing; }
.step-number { background: var(--accent); color: white; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 600; flex-shrink: 0; }
.step-remove { position: absolute; top: 10px; right: 10px; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; opacity: 0.6; }
.step-remove:hover { opacity: 1; color: var(--danger); }
.step-textarea { width: 100%; min-height: 60px; }
.step-photo-area { margin-top: 10px; display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.step-photo-preview { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.step-photo-btn { padding: 8px 12px; font-size: 0.8rem; }

/* Steps Gallery in Detail */
.steps-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }
.step-gallery-item { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.step-gallery-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-strong); }
.step-gallery-image { width: 100%; height: 150px; object-fit: cover; }
.step-gallery-content { padding: 12px; }
.step-gallery-number { font-size: 0.75rem; color: var(--accent); font-weight: 600; }
.step-gallery-text { font-size: 0.85rem; margin-top: 5px; color: var(--text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Lightbox */
.lightbox-content { position: relative; max-width: 90vw; max-height: 90vh; display: flex; align-items: center; justify-content: center; }
.lightbox-image-container { text-align: center; }
.lightbox-image-container img { max-width: 100%; max-height: 80vh; border-radius: 8px; }
.lightbox-caption { color: white; margin-top: 15px; font-size: 1rem; max-width: 600px; line-height: 1.5; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.2); border: none; color: white; font-size: 3rem; cursor: pointer; padding: 20px 15px; transition: background 0.2s; }
.lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.lightbox-nav.prev { left: 10px; }
.lightbox-nav.next { right: 10px; }
.lightbox-close { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.5); border: none; color: white; font-size: 1.5rem; cursor: pointer; padding: 10px 15px; border-radius: 8px; }
.lightbox-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: white; font-size: 0.9rem; background: rgba(0,0,0,0.5); padding: 5px 15px; border-radius: 20px; }

/* Recipe Cards */
.recipes-list { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
  gap: 1.2rem; 
  margin-top: 0.6rem; 
  max-width: 1200px;
}
.recipes-list > * { max-width: 380px; }
@media (min-width: 900px) {
  .recipes-list { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1400px) {
  .recipes-list { grid-template-columns: repeat(4, 1fr); max-width: 1600px; }
}
.recipe-card { border-radius: 14px; border: 1px solid var(--border); background: var(--bg-card); padding: 0.75rem 0.8rem; display: flex; flex-direction: column; gap: 0.35rem; box-shadow: var(--shadow-soft); transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.recipe-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-strong); border-color: var(--accent); }
.recipe-card.deleting { animation: cardDelete 0.4s ease forwards; }
@keyframes cardDelete { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0.8); } }
.recipe-card-header { display: flex; justify-content: space-between; gap: 0.5rem; align-items: flex-start; }
.recipe-title { font-size: 0.95rem; font-weight: 600; margin: 0; }
.recipe-meta { font-size: 0.75rem; color: var(--text-muted); }
.recipe-sv { font-size: 0.8rem; margin-top: 0.2rem; }
.badge { display: inline-flex; align-items: center; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.7rem; border: 1px solid var(--border); color: var(--text-muted); }
.badge.public { border-color: var(--success); color: var(--success); background: rgba(34, 197, 94, 0.1); }
.badge.private { border-color: var(--danger); color: var(--danger); background: rgba(239, 68, 68, 0.1); }
.recipe-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.recipe-actions .btn { font-size: 0.75rem; padding: 0.25rem 0.65rem; }
.recipe-card-image { width: 100%; height: 140px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; }
.recipe-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.recipe-tag { font-size: 0.7rem; padding: 2px 8px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 10px; color: var(--accent); }
.recipe-rating { font-size: 0.8rem; color: var(--warning); }

/* Servings Adjuster */
.servings-adjuster { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg-soft); border-radius: 12px; margin: 16px 0; flex-wrap: wrap; }
.servings-adjuster label { font-size: 0.85rem; font-weight: 500; }
.servings-controls { display: flex; align-items: center; gap: 8px; }
.servings-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.servings-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }
.servings-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.servings-value { font-size: 1.2rem; font-weight: 600; min-width: 40px; text-align: center; }
.servings-original { font-size: 0.75rem; color: var(--text-muted); }

/* Share Buttons */
.share-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.share-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; font-size: 0.85rem; font-weight: 500; cursor: pointer; border: none; transition: all 0.2s; }
.share-btn:hover { transform: translateY(-1px); }
.share-btn.whatsapp { background: #25D366; color: white; }
.share-btn.telegram { background: #0088cc; color: white; }
.share-btn.copy { background: var(--bg-soft); color: var(--text); border: 1px solid var(--border); }
.share-btn.email { background: #EA4335; color: white; }

/* Shopping List */
.shopping-recipes { margin-bottom: 20px; }
.shopping-recipe-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg-soft); border-radius: 8px; margin-bottom: 8px; }
.shopping-recipe-item .title { flex: 1; font-size: 0.9rem; }
.shopping-recipe-item .remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; }
.shopping-list { display: flex; flex-direction: column; gap: 8px; }
.shopping-item { display: flex; align-items: center; gap: 10px; padding: 10px 15px; background: var(--bg-soft); border-radius: 8px; transition: all 0.2s; }
.shopping-item.checked { opacity: 0.5; text-decoration: line-through; }
.shopping-item input[type="checkbox"] { width: 20px; height: 20px; cursor: pointer; }
.shopping-item .ingredient { flex: 1; font-size: 0.9rem; }
.shopping-item .source { font-size: 0.75rem; color: var(--text-muted); }

/* Collections */
.collections-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
.collection-card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 15px; cursor: pointer; transition: all 0.2s; text-align: center; }
.collection-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.collection-icon { font-size: 2rem; margin-bottom: 8px; }
.collection-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 5px; }
.collection-count { font-size: 0.8rem; color: var(--text-muted); }
.collection-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; }
.collection-option { display: flex; align-items: center; gap: 10px; padding: 12px 15px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: all 0.2s; }
.collection-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.collection-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.collection-recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.collection-recipe-item { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--bg-soft); border-radius: 10px; cursor: pointer; transition: all 0.2s; }
.collection-recipe-item:hover { background: var(--accent-soft); }
.collection-recipe-item img { width: 50px; height: 50px; object-fit: cover; border-radius: 8px; }
.collection-recipe-item .info { flex: 1; }
.collection-recipe-item .title { font-size: 0.9rem; font-weight: 500; }
.collection-recipe-item .meta { font-size: 0.75rem; color: var(--text-muted); }

/* Timer Notifications */
.notification-status { padding: 10px 15px; border-radius: 8px; margin-bottom: 15px; font-size: 0.85rem; }
.notification-status.granted { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.notification-status.denied { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.notification-status.default { background: var(--bg-soft); color: var(--text-muted); }

/* Detail */
#recipe-detail { font-size: 0.9rem; }
#recipe-detail h3 { margin: 0.3rem 0 0.25rem; font-size: 0.95rem; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin-top: 0.3rem; }
.detail-box { background: var(--bg-soft); border-radius: 12px; border: 1px solid var(--border); padding: 0.6rem 0.7rem; }
.detail-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.detail-value { font-size: 0.9rem; }
.detail-image { width: 100%; max-height: 400px; object-fit: cover; border-radius: 12px; margin-bottom: 16px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; }
.stat-card { background: var(--bg-soft); border-radius: 12px; border: 1px solid var(--border); padding: 1rem; text-align: center; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* Timer */
.timer-card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-bottom: 0.8rem; }
.timer-card.active { border-color: var(--accent); box-shadow: 0 0 20px var(--accent-soft); }
.timer-card.completed { border-color: var(--success); background: rgba(34, 197, 94, 0.1); animation: timerComplete 0.5s ease; }
@keyframes timerComplete { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.timer-card h4 { margin: 0 0 8px; font-size: 0.95rem; }
.timer-display { font-size: 2rem; font-weight: 700; font-family: monospace; color: var(--accent); margin: 8px 0; }
.timer-controls { display: flex; gap: 8px; flex-wrap: wrap; }

/* Calculator */
.calc-value { font-size: 1.3rem; font-weight: 600; margin: 8px 0; }
.result-box { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-top: 1rem; }

/* Cooking Mode */
.cooking-mode { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg); z-index: 1000; padding: 30px; overflow-y: auto; }
.cooking-mode h1 { font-size: 2rem; text-align: center; margin-bottom: 30px; }
.cooking-section { background: var(--bg-card); border-radius: 16px; padding: 24px; margin-bottom: 20px; border: 1px solid var(--border); }
.cooking-section h2 { font-size: 1.2rem; margin: 0 0 16px; }
.cooking-temp { font-size: 3rem; font-weight: 700; color: var(--warning); text-align: center; }
.cooking-time { font-size: 2rem; color: var(--success); text-align: center; }
.cooking-step { font-size: 1.1rem; padding: 8px 0; border-bottom: 1px solid var(--border); }
.cooking-step:last-child { border-bottom: none; }
.cooking-steps-slider { margin-top: 30px; }
.cooking-step-slide { display: flex; flex-direction: column; align-items: center; padding: 20px; background: var(--bg-card); border-radius: 16px; border: 1px solid var(--border); }
.cooking-step-slide img { max-width: 100%; max-height: 300px; border-radius: 12px; margin-bottom: 15px; }
.cooking-step-slide .step-text { font-size: 1.2rem; text-align: center; }

/* Modal */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-content { 
  background: var(--bg-card); 
  border: 1px solid var(--border); 
  border-radius: 16px; 
  padding: 24px; 
  max-width: 450px; 
  width: 100%; 
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  animation: modalEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
}
@keyframes modalEnter { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-content h3 { margin: 0 0 16px; font-size: 1.1rem; }

@media (max-width: 768px) {
  .modal { padding: 10px; align-items: flex-end; }
  .modal-content {
    max-height: 95vh;
    border-radius: 20px 20px 0 0;
    max-width: 100%;
  }
}

/* Comments */
.comment { background: var(--bg-soft); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.comment-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.comment-author { font-weight: 600; font-size: 0.85rem; }
.comment-date { font-size: 0.75rem; color: var(--text-muted); }
.comment-text { font-size: 0.9rem; line-height: 1.4; }

/* Loading State */
.loading { text-align: center; padding: 40px; color: var(--text-muted); }

/* Utility */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.muted { color: var(--text-muted); font-size: 0.85rem; }
.message { margin-top: 0.6rem; min-height: 1rem; font-size: 0.8rem; }
.message.error { color: var(--danger); }
.message.success { color: var(--success); }

/* Responsive */
@media (max-width: 600px) {
  .toast-container { left: 10px; right: 10px; max-width: none; }
  .controls { flex-direction: column; }
  .controls-left, .controls-right { width: 100%; justify-content: center; }
  .form-header { flex-direction: column; align-items: flex-start; }
  .filters-advanced { flex-direction: column; }
  .filter-group { width: 100%; }
  .share-buttons { flex-direction: column; }
  .share-btn { width: 100%; justify-content: center; }
  .user-area { width: 100%; justify-content: center; }
  .lightbox-nav { padding: 10px; font-size: 2rem; }
}

/* Image Crop Modal */
#crop-modal .modal-content { max-width: 90vw; max-height: 90vh; }
#crop-container { position: relative; display: flex; justify-content: center; align-items: center; background: #000; border-radius: 12px; overflow: hidden; margin: 15px 0; }
#crop-image { max-width: 100%; max-height: 400px; display: block; }
#crop-area { position: absolute; border: 3px solid var(--accent); background: rgba(14, 165, 233, 0.2); cursor: move; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6); }
.crop-resize { position: absolute; bottom: -5px; right: -5px; width: 20px; height: 20px; background: var(--accent); border-radius: 50%; cursor: se-resize; }
#crop-canvas { display: none; }
.crop-actions { display: flex; gap: 10px; justify-content: center; margin-top: 15px; }

/* Export/Import Modal */
.export-options { display: flex; flex-direction: column; gap: 15px; margin: 20px 0; }
.export-option { display: flex; align-items: center; gap: 15px; padding: 15px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: all 0.2s; }
.export-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.export-option .icon { font-size: 2rem; }
.export-option .info h4 { margin: 0 0 5px; font-size: 1rem; }
.export-option .info p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.import-area { border: 2px dashed var(--border); border-radius: 12px; padding: 30px; text-align: center; cursor: pointer; transition: all 0.2s; }
.import-area:hover { border-color: var(--accent); background: var(--accent-soft); }
.import-area input { display: none; }

/* ============================================================================
   V5 STYLES - Additional Features
   ============================================================================ */

/* Offline Indicator */
#offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--warning);
  color: #000;
  text-align: center;
  padding: 8px;
  font-weight: 600;
  z-index: 10000;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
#offline-indicator.visible { transform: translateY(0); }

/* Planner */
.planner-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.planner-header h3 { margin: 0; font-size: 1rem; }
.planner-grid { overflow-x: auto; }
.planner-row { display: flex; min-width: 700px; }
.planner-row-header { background: var(--bg-soft); font-weight: 600; }
.planner-cell { flex: 1; min-width: 90px; padding: 10px; border: 1px solid var(--border); }
.planner-day-header { text-align: center; font-size: 0.8rem; }
.planner-day-header.today { background: var(--accent-soft); color: var(--accent); }
.planner-meal-label { font-size: 0.75rem; background: var(--bg-soft); display: flex; align-items: center; }
.planner-meal-cell { min-height: 60px; position: relative; }
.planner-recipe { font-size: 0.7rem; padding: 4px 6px; background: var(--accent-soft); border-radius: 4px; margin-bottom: 4px; cursor: pointer; }
.planner-recipe:hover { background: var(--accent); color: white; }
.planner-add-btn { position: absolute; bottom: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%; border: none; background: var(--border); cursor: pointer; font-size: 14px; line-height: 1; }
.planner-add-btn:hover { background: var(--accent); color: white; }
.planner-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: center; }

/* V13 - New planner styles */
.planner-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.planner-recipe.custom-meal {
  background: var(--success-soft);
  border-left: 3px solid var(--success);
}

.planner-recipe.custom-meal:hover {
  background: var(--success);
  color: white;
}

.planner-drop-target {
  background: var(--accent-soft) !important;
  border: 2px dashed var(--accent) !important;
}

.planner-recipe.dragging {
  opacity: 0.5;
}

/* SortableJS styles */
.sortable-ghost {
  opacity: 0.4;
  background: var(--bg-soft) !important;
  border: 2px dashed var(--accent) !important;
}

.sortable-drag {
  opacity: 1;
  cursor: grabbing !important;
  transform: rotate(2deg);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.recipe-picker-divider {
  margin: 15px 0;
  padding: 10px;
  background: var(--bg-soft);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 4px;
}

.custom-meal-item {
  border-left: 3px solid var(--success);
}

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

.ingredient-row .btn-sm {
  padding: 4px 8px;
  font-size: 1.2rem;
  line-height: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

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

.modal-body {
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.planner-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

/* V13 - Shopping List Swipe Delete */
.shopping-item-swipe {
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
  border-radius: 8px;
  background: var(--bg);
}

.shopping-item-swipe.checked .shopping-item-content {
  opacity: 0.6;
}

.shopping-item-swipe.checked .ingredient {
  text-decoration: line-through;
  color: var(--text-muted);
}

.shopping-item-content {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  gap: 12px;
  cursor: pointer;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 2;
}

.shopping-item-content:hover {
  background: var(--bg-soft);
}

.shopping-item-content input[type="checkbox"] {
  cursor: pointer;
  width: 20px;
  height: 20px;
  margin: 0;
}

.shopping-item-content .ingredient {
  flex: 1;
  font-size: 0.95rem;
}

.shopping-item-delete {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  background: var(--error);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
  z-index: 1;
  border-radius: 8px;
}

.shopping-item-delete:hover {
  background: #c62828;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
}

/* Custom Meal Modal - Ingredient Row Fix */
.custom-ingredient-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.custom-ingredient-row input {
  min-width: 0; /* Prevent overflow */
}

.custom-ingredient-row .btn-icon {
  grid-column: 4;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Form inputs responsive */
.form-input {
  width: 100%;
  box-sizing: border-box;
}

/* AI Assistant Tips Pagination */
/* Recipe Picker */
.recipe-picker-item { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.recipe-picker-item:hover { background: var(--bg-soft); }
.recipe-picker-item .emoji { font-size: 1.5rem; }
.recipe-picker-item .info .title { font-weight: 500; }
.recipe-picker-item .info .meta { font-size: 0.8rem; color: var(--text-muted); }

/* Profile */
.profile-header { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 25px; flex-wrap: wrap; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: bold; }
.profile-info { flex: 1; min-width: 200px; }
.profile-info h2 { margin: 0 0 5px; }
.profile-bio { color: var(--text-muted); margin: 0 0 10px; }
.profile-stats { display: flex; gap: 15px; font-size: 0.9rem; }
.profile-stats span strong { font-size: 1.1rem; }

.achievements-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.achievement { display: flex; align-items: center; gap: 5px; padding: 8px 12px; background: var(--bg-soft); border-radius: 20px; font-size: 0.85rem; }
.achievement span:first-child { font-size: 1.2rem; }

.profile-recipes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; }
.profile-recipe-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; transition: transform 0.2s; }
.profile-recipe-card:hover { transform: translateY(-3px); }
.profile-recipe-card img, .profile-recipe-card .no-image { width: 100%; height: 100px; object-fit: cover; }
.profile-recipe-card .no-image { display: flex; align-items: center; justify-content: center; background: var(--bg-soft); font-size: 2rem; }
.profile-recipe-card .info { padding: 10px; }
.profile-recipe-card .title { font-weight: 500; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-recipe-card .meta { font-size: 0.75rem; color: var(--text-muted); }

/* Rating Widget */
.rating-widget { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rating-label { font-size: 0.9rem; color: var(--text-muted); }
.rating-stars { display: flex; gap: 3px; }
.rating-star { font-size: 1.5rem; color: var(--border); cursor: pointer; transition: transform 0.1s; }
.rating-star:hover { transform: scale(1.2); }
.rating-star.active, .rating-star.hover { color: #fbbf24; }
.rating-avg { font-size: 0.85rem; color: var(--text-muted); }

/* Conversion Settings */
.unit-option { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.unit-option label { font-weight: 500; }

/* Quick Converter */
.converter-inputs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.converter-inputs input { flex: 1; min-width: 80px; }
.converter-inputs select { flex: 1; min-width: 80px; }
#convert-result { text-align: center; font-size: 1.2rem; font-weight: 600; padding: 15px; background: var(--bg-soft); border-radius: 8px; }

/* AI Assistant */
.ai-tabs { display: flex; gap: 5px; margin-bottom: 20px; flex-wrap: wrap; }
.ai-tab { padding: 8px 15px; background: var(--bg-soft); border: none; border-radius: 20px; cursor: pointer; font-size: 0.85rem; }
.ai-tab.active { background: var(--accent); color: white; }
.ai-tab-content { display: block; }
.ai-tab-content.hidden { display: none; }

.ai-result { margin-top: 20px; padding: 15px; background: var(--bg-soft); border-radius: 12px; }
.ai-result h4 { margin: 0 0 15px; }
.ai-result-values { display: flex; gap: 20px; margin-bottom: 15px; }
.ai-result-values .value { text-align: center; }
.ai-result-values .label { font-size: 0.8rem; color: var(--text-muted); display: block; }
.ai-result-values .num { font-size: 1.5rem; font-weight: 600; color: var(--accent); }

.ai-tips { background: var(--bg); padding: 15px; border-radius: 8px; }
.ai-tips h5 { margin: 0 0 10px; }
.ai-tips ul { margin: 0; padding-left: 20px; }
.ai-tips li { margin-bottom: 5px; font-size: 0.9rem; }

.ai-recipe-suggestion { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-bottom: 1px solid var(--border); }
.ai-recipe-suggestion .info h5 { margin: 0 0 5px; }
.ai-recipe-suggestion .info p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.ai-recipe-suggestion .meta { font-size: 0.8rem; color: var(--accent); }

/* AI Tips - Fixed overflow */
.ai-tips-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px;
  background: var(--bg-soft);
  border-radius: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-tips-navigation button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#ai-tips-page-info {
  font-weight: 600;
  font-size: 0.9rem;
}

.ai-tips-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 5px;
  -webkit-overflow-scrolling: touch;
}

.ai-tip {
  background: var(--bg-soft);
  padding: 15px;
  border-radius: 12px;
  border-left: 3px solid var(--accent);
  transition: all 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.ai-tip:hover {
  transform: translateX(3px);
  border-left-color: var(--success);
  box-shadow: var(--shadow-soft);
}

.ai-tip h4 {
  margin: 0 0 8px 0;
  font-size: 1rem;
  color: var(--text);
  word-wrap: break-word;
}

.ai-tip p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
  word-wrap: break-word;
}

/* Language Selector */
.language-option { display: flex; align-items: center; gap: 12px; padding: 15px; border-bottom: 1px solid var(--border); cursor: pointer; }
.language-option:hover { background: var(--bg-soft); }
.language-option.active { background: var(--accent-soft); }
.language-option .flag { font-size: 1.5rem; }
.language-option .name { flex: 1; font-weight: 500; }
.language-option .check { color: var(--accent); font-weight: bold; }

/* Analytics */
.analytics-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 15px; margin-bottom: 25px; }
.analytics-card { background: var(--bg-soft); padding: 20px; border-radius: 12px; text-align: center; }
.analytics-value { font-size: 2rem; font-weight: 700; color: var(--accent); }
.analytics-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 5px; }

.analytics-section { margin-bottom: 25px; }
.analytics-section h4 { margin: 0 0 15px; font-size: 1rem; }

.analytics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
.analytics-stat { background: var(--bg-soft); padding: 12px; border-radius: 8px; text-align: center; }
.analytics-stat .label { display: block; font-size: 0.75rem; color: var(--text-muted); }
.analytics-stat .value { display: block; font-size: 1.2rem; font-weight: 600; margin-top: 5px; }

.analytics-chart { display: flex; flex-direction: column; gap: 10px; }
.chart-bar { display: flex; align-items: center; gap: 10px; }
.bar-label { width: 100px; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 20px; background: var(--bg-soft); border-radius: 10px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 10px; transition: width 0.5s ease; }
.bar-value { width: 70px; font-size: 0.8rem; text-align: right; color: var(--text-muted); }

.analytics-timeline { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 10px 0; }
.timeline-bar { flex: 1; display: flex; flex-direction: column; align-items: center; }
.timeline-fill { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 4px; transition: height 0.3s ease; }
.timeline-label { font-size: 0.65rem; color: var(--text-muted); margin-top: 5px; }

.analytics-list { display: flex; flex-direction: column; }
.analytics-list-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.analytics-list-item .rank { font-weight: 700; color: var(--accent); width: 30px; }
.analytics-list-item .title { flex: 1; }
.analytics-list-item .meta { font-size: 0.8rem; color: var(--text-muted); }

.analytics-insights { display: flex; flex-direction: column; gap: 10px; }
.insight { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--bg-soft); border-radius: 8px; }
.insight .icon { font-size: 1.2rem; }

/* Cooking Log */
.cooking-log-entry { padding: 15px 0; border-bottom: 1px solid var(--border); }
.cooking-log-entry .date { font-size: 0.8rem; color: var(--text-muted); }
.cooking-log-entry .recipe { font-weight: 500; margin: 5px 0; }
.cooking-log-entry .notes { font-size: 0.9rem; color: var(--text-muted); font-style: italic; }

/* Print Styles */
@media print {
  body { background: white !important; }
  .no-print, #offline-indicator, .toast-container, nav, footer { display: none !important; }
  .recipe-card { break-inside: avoid; page-break-inside: avoid; }
  .modal { position: static !important; display: block !important; }
  .modal-content { box-shadow: none !important; max-width: 100% !important; }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --border: #000;
    --text-muted: #333;
  }
  [data-theme="dark"] {
    --border: #fff;
    --text-muted: #ccc;
  }
}

/* Save Confirm Dialog */
.save-confirm-dialog {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  animation: fadeIn 0.2s ease;
}

.save-confirm-content {
  background: var(--bg);
  padding: 25px;
  border-radius: 16px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.save-confirm-content h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.save-confirm-content p {
  margin: 0 0 20px;
  color: var(--text-muted);
}

.save-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.save-confirm-actions .btn {
  min-width: 80px;
}

/* Quick Converter close button fix */
#quick-converter-modal .btn-outline:last-child {
  margin-top: 15px;
}

/* Detail Controls - Porzioni + Toggle Unità */
.detail-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 15px;
  background: var(--bg-soft);
  border-radius: 12px;
}

/* Units Toggle */
.units-toggle {
  display: flex;
  align-items: center;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
  background: var(--border);
  border-radius: 13px;
  transition: background 0.3s;
  cursor: pointer;
}

.toggle-switch.active {
  background: var(--accent);
}

.toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.active .toggle-slider {
  transform: translateX(24px);
}

@media (max-width: 500px) {
  .detail-controls {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Rating Section */
.rating-section {
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 15px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

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

.rating-score {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}

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

.rating-input {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rating-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.star-rating {
  display: flex;
  gap: 2px;
}

.star-rating .star {
  font-size: 1.5rem;
  color: var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.star-rating .star:hover,
.star-rating .star.hover {
  color: #fbbf24;
  transform: scale(1.2);
}

.star-rating .star.selected {
  color: #f59e0b;
}

.star-rating .star:active {
  transform: scale(0.95);
}

@media (max-width: 500px) {
  .rating-section {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .star-rating .star {
    font-size: 1.3rem;
  }
}

/* Rating sulla Card */
.recipe-card .recipe-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  font-size: 0.9rem;
}

.recipe-card .recipe-rating .stars {
  color: #f59e0b;
  letter-spacing: 1px;
}

.recipe-card .recipe-rating .rating-value {
  font-weight: 700;
  color: var(--accent);
}

.recipe-card .recipe-rating .rating-votes {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.recipe-card .recipe-rating.no-rating {
  opacity: 0.6;
}

.recipe-card .recipe-rating.no-rating .stars {
  color: var(--border);
}


.step-item[draggable="true"] {
  cursor: move;
}

.step-item.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(14,165,233,0.3);
}

.step-photo-preview[draggable="true"] {
  cursor: move;
}


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

.planner-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.planner-header-info h3 {
  margin: 0;
}

.planner-subtitle {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.planner-day-header.weekend {
  background: var(--bg-soft);
  font-weight: 500;
  opacity: 0.9;
}


.ai-modal {
  max-height: 90vh;
}

.ai-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .ai-layout {
    grid-template-columns: 1fr;
  }
}

.ai-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-summary-panel,
.ai-helper-panel {
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
}

.ai-summary-panel h4,
.ai-helper-panel h4 {
  margin: 0 0 8px;
}

.ai-summary-placeholder {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ai-helper-panel ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.85rem;
}

.ai-helper-panel li {
  margin-bottom: 4px;
}


.planner-meal-cell {
  position: relative;
  min-height: 44px;
}

.planner-recipe.dragging {
  opacity: 0.6;
  box-shadow: 0 0 0 2px var(--accent, #0ea5e9);
}

.planner-meal-cell.planner-drop-target {
  outline: 2px dashed var(--accent, #0ea5e9);
  outline-offset: 2px;
  background-color: rgba(56, 189, 248, 0.08);
}

/* ============================================================================
   PLANNER VIEW MODES
   ============================================================================ */

/* View Mode Selector */
.view-mode-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background: var(--bg-soft);
  border-radius: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.view-mode-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

.view-mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
}

.view-mode-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.view-mode-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.view-mode-icon {
  font-size: 1.1rem;
}

.view-mode-text {
  font-weight: 500;
}

@media (max-width: 600px) {
  .view-mode-text {
    display: none;
  }
  .view-mode-btn {
    padding: 8px;
  }
}

/* ============================================================================
   DAY VIEW
   ============================================================================ */

.planner-week-overview {
  display: flex;
  justify-content: space-around;
  padding: 15px;
  background: var(--bg-soft);
  border-radius: 12px;
  margin-bottom: 20px;
  gap: 5px;
}

.week-day-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  min-width: 45px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.week-day-mini:hover {
  background: var(--accent-soft);
}

.week-day-mini.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.day-letter {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.day-number {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2px 0;
}

.day-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  margin-top: 6px;
  transition: all 0.2s;
}

.day-indicator.has-meals {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.planner-day-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  margin-bottom: 20px;
}

.planner-day-nav h2 {
  margin: 0;
  font-size: 1.4rem;
}

.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover:not(:disabled) {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-icon:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.planner-meals-container {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-bottom: 25px;
}

.planner-meal-section h3 {
  margin: 0 0 15px;
  font-size: 1.2rem;
  padding-left: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.planner-meal-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.planner-meal-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  transition: all 0.2s;
}

.planner-meal-card:hover {
  box-shadow: var(--shadow-strong);
  transform: translateY(-2px);
}

.planner-meal-card.custom-meal {
  border-left: 3px solid var(--warning);
}

.meal-emoji {
  font-size: 2.5rem;
  flex-shrink: 0;
}

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

.meal-name {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meal-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.meal-remove {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: white;
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.meal-remove:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.planner-add-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-soft);
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 80px;
}

.planner-add-card:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.add-icon {
  font-size: 2rem;
  margin-bottom: 5px;
  color: var(--text-muted);
}

.add-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================================================
   ACCORDION VIEW
   ============================================================================ */

.planner-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 25px;
}

.accordion-day {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}

.accordion-day.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.accordion-day.expanded {
  box-shadow: var(--shadow-soft);
}

.accordion-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.accordion-header:hover {
  background: var(--bg-soft);
}

.accordion-arrow {
  font-size: 0.9rem;
  transition: transform 0.2s;
  color: var(--text-muted);
}

.accordion-title {
  flex: 1;
  font-weight: 600;
  font-size: 1.05rem;
}

.accordion-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 4px 10px;
  border-radius: 12px;
}

.accordion-content {
  padding: 0 15px 15px;
  border-top: 1px solid var(--border);
}

.accordion-meal {
  margin-bottom: 20px;
}

.accordion-meal:last-child {
  margin-bottom: 0;
}

.accordion-meal h4 {
  margin: 15px 0 10px;
  font-size: 1rem;
  color: var(--text-muted);
}

.accordion-meal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-soft);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.2s;
}

.accordion-meal-item:hover {
  background: var(--accent-soft);
}

.accordion-meal-item .item-name {
  flex: 1;
  font-size: 0.95rem;
}

.accordion-meal-item .item-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.accordion-meal-item .item-remove:hover {
  transform: scale(1.1);
}

.accordion-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 10px 0;
  font-style: italic;
}

.accordion-add-btn {
  width: 100%;
  padding: 10px;
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.2s;
  margin-top: 10px;
}

.accordion-add-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================================
   CARDS VIEW
   ============================================================================ */

.planner-cards-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 25px;
}

.day-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  transition: all 0.2s;
}

.day-card.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-soft);
}

.day-card-header h3 {
  margin: 0 0 15px;
  font-size: 1.3rem;
  color: var(--text);
}

.day-card-meals {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.card-meal-section h4 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--text-muted);
}

.card-meal-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-meal-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border-radius: 20px;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.card-meal-item:hover {
  background: var(--accent-soft);
}

.card-meal-item .item-emoji {
  font-size: 1.2rem;
}

.card-meal-item .item-name {
  font-weight: 500;
}

.card-meal-item .item-remove-mini {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-left: 4px;
}

.card-meal-item .item-remove-mini:hover {
  transform: scale(1.15);
}

.card-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.2s;
}

.card-add-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
  .planner-week-overview {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .planner-week-overview::-webkit-scrollbar {
    display: none;
  }
  
  .week-day-mini {
    min-width: 50px;
  }
  
  .planner-day-nav h2 {
    font-size: 1.2rem;
  }
  
  .meal-emoji {
    font-size: 2rem;
  }
  
  .view-mode-selector {
    justify-content: center;
  }
}

/* ============================================================================
   QUICK CUSTOM MEAL FORM
   ============================================================================ */

.recipe-picker-create-custom {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-soft));
  border: 2px dashed var(--accent);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 15px;
}

.recipe-picker-create-custom:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: var(--accent-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.recipe-picker-create-custom:hover .create-title {
  color: white;
}

.recipe-picker-create-custom:hover .create-subtitle {
  color: rgba(255, 255, 255, 0.9);
}

.create-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.create-info {
  flex: 1;
}

.create-title {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 2px;
  color: var(--text);
  transition: color 0.2s;
}

.create-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.quick-custom-meal-form {
  padding: 10px;
}

.quick-custom-meal-form h4 {
  margin: 0 0 20px;
  font-size: 1.2rem;
  color: var(--text);
}

.quick-custom-meal-form .form-group {
  margin-bottom: 15px;
}

.quick-custom-meal-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.9rem;
}

.quick-ingredient-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.quick-ingredient-row input {
  flex: 1;
}

.quick-ing-name {
  flex: 2 !important;
}

.btn-icon-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-icon-small:hover {
  background: #dc2626;
  transform: scale(1.1);
}

#quick-ingredients-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 8px;
}

@media (max-width: 600px) {
  .quick-ingredient-row {
    flex-wrap: wrap;
  }
  
  .quick-ing-name {
    width: 100% !important;
    flex: none !important;
  }
  
  .quick-ing-qty,
  .quick-ing-unit {
    flex: 1;
  }
}

/* ============================================================================
   MANUAL SHOPPING ITEMS
   ============================================================================ */

.shopping-add-manual {
  margin: 15px 0 20px;
  padding: 15px;
  background: var(--bg-soft);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.shopping-add-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.shopping-add-form input {
  flex: 1;
  min-width: 0;
}

.shopping-add-form .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .shopping-add-form {
    flex-direction: column;
  }
  
  .shopping-add-form input,
  .shopping-add-form .btn {
    width: 100%;
  }
}

/* ============================================================================
   SHOPPING ITEM ENHANCED (Notes + Photos)
   ============================================================================ */

.shopping-item-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.shopping-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-note-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shopping-item-indicators {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.indicator-icon {
  font-size: 1.1rem;
  opacity: 0.7;
  transition: all 0.2s;
}

.shopping-item-swipe.has-photo .photo-icon {
  opacity: 1;
  animation: pulse 2s infinite;
}

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

.shopping-item-actions {
  display: flex;
  gap: 8px;
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  background: var(--bg-card);
  align-items: center;
  padding: 0 10px;
  transform: translateX(100%);
  transition: transform 0.3s;
}

.shopping-item-swipe:hover .shopping-item-actions,
.shopping-item-swipe.swiped .shopping-item-actions {
  transform: translateX(0);
}

.shopping-item-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-soft);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shopping-item-action-btn:hover {
  transform: scale(1.1);
}

.shopping-item-action-btn.delete-btn {
  background: var(--danger);
  color: white;
}

.shopping-item-action-btn.delete-btn:hover {
  background: #dc2626;
}

/* Photo Preview Modal */
.shopping-item-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
}

.preview-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
}

.preview-modal-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.preview-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 2;
  transition: all 0.2s;
}

.preview-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: rotate(90deg);
}

.preview-image {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: var(--bg-soft);
}

.preview-info {
  padding: 20px;
  background: var(--bg-card);
}

.preview-info h3 {
  margin: 0 0 10px;
  font-size: 1.3rem;
}

.preview-qty {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 5px 0;
}

.preview-note {
  background: var(--bg-soft);
  padding: 10px;
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  margin-top: 10px;
  font-style: italic;
}

/* Edit Modal Enhancements */
.current-photo-preview {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  background: var(--bg-soft);
  border-radius: 8px;
  margin-bottom: 10px;
}

.current-photo-preview img {
  border: 2px solid var(--border);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .shopping-item-indicators {
    font-size: 0.9rem;
  }
  
  .shopping-item-action-btn {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  
  .preview-modal-content {
    max-width: 95vw;
    max-height: 95vh;
  }
  
  .preview-info {
    padding: 15px;
  }
}

/* Long Press Visual Feedback */
.shopping-item-swipe {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.shopping-item-swipe.has-photo .shopping-item-content {
  cursor: pointer;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* CSS for Recipe Import Feature */

/* Loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--bg-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Loading steps */
.loading-step {
  margin: 10px 0;
  transition: opacity 0.3s ease;
}

/* Info box */
.info-box {
  background: var(--bg-soft);
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
}

/* Tag style (if not already defined) */
.tag {
  display: inline-block;
  background: var(--bg-soft);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  margin: 2px;
}

/* Alert styles */
.alert {
  padding: 12px 15px;
  border-radius: 8px;
  margin: 15px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--text-primary);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--text-primary);
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--text-primary);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--text-primary);
}

/* Import preview styles */
.import-preview-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 8px;
  margin: 15px 0;
}

.import-preview-meta {
  display: flex;
  gap: 15px;
  margin: 15px 0;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.import-preview-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.import-preview-section {
  background: var(--bg-soft);
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
}

.import-preview-section h4 {
  margin: 0 0 10px 0;
  font-size: 1.1rem;
}

.import-preview-section ul,
.import-preview-section ol {
  margin: 0;
  padding-left: 20px;
}

.import-preview-section li {
  margin-bottom: 8px;
}

/* Source link */
.source-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 15px 0;
}

.source-link a {
  color: var(--primary);
  text-decoration: none;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .import-preview-meta {
    flex-direction: column;
    gap: 8px;
  }
  
  .import-preview-section {
    padding: 12px;
  }
}
