/* ForkFolio CSS - Premium Styling System */

/* Design Tokens & Root Custom Variables */
:root {
  /* Fonts */
  --font-heading: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Global Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 24px;
  --border-radius-full: 9999px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.2);

  /* HSL Colors (Midnight Gastro-Bar with Savory Olive & Golden Yolk) */
  --hue-primary: 14;     /* Electric Blood Orange (#FF5722) */
  --hue-secondary: 43;   /* Golden Yolk (#FFB703) */
  --hue-neutral: 220;    /* Midnight Truffle & Slate Slate */

  /* Theme Dependent Variables (Defined for Light Theme first, toggled to Dark below) */
  --primary: hsl(var(--hue-primary), 88%, 50%);
  --primary-hover: hsl(var(--hue-primary), 92%, 44%);
  --primary-glow: hsla(var(--hue-primary), 100%, 57%, 0.16);
  
  --secondary: hsl(var(--hue-secondary), 95%, 48%);
  
  --accent: #588157; /* Savory Olive / Rosemary herb */
  --accent-hover: #476a46;
  --accent-glow: rgba(88, 129, 87, 0.22);
  --danger: hsl(0, 84%, 60%);
  --danger-hover: hsl(0, 84%, 50%);
  
  --bg-app: hsl(var(--hue-neutral), 20%, 97%);
  --bg-card: hsl(0, 0%, 100%);
  --bg-nav: rgba(255, 255, 255, 0.85);
  --border-color: hsl(var(--hue-neutral), 15%, 88%);
  
  --text-main: hsl(var(--hue-neutral), 25%, 12%);
  --text-muted: hsl(var(--hue-neutral), 15%, 45%);
  --text-white: #ffffff;
  
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: blur(12px);
}

/* Dark Theme Overrides (Midnight Gastro-Bar) */
.dark-theme,
body.dark-theme {
  --primary: hsl(var(--hue-primary), 100%, 57%);
  --primary-hover: hsl(var(--hue-primary), 100%, 50%);
  --primary-glow: hsla(var(--hue-primary), 100%, 57%, 0.22);

  --secondary: hsl(var(--hue-secondary), 100%, 51%);

  --accent: #588157;
  --accent-hover: #6a9b69;
  --accent-glow: rgba(88, 129, 87, 0.3);

  --bg-app: #0B0D11;
  --bg-card: #151821;
  --bg-nav: rgba(11, 13, 17, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  
  --text-main: #F3F4F6;
  --text-muted: #94A3B8;
  
  --glass-bg: rgba(21, 24, 33, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.65);
}

/* Base Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Utility Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--border-radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn i,
.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-white);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

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

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--border-color);
  border-color: var(--text-muted);
}

.btn-accent {
  background-color: var(--accent);
  color: var(--text-white);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-icon-round {
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background-color: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: var(--glass-blur);
}

.btn-icon-round i,
.btn-icon-round svg {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

.btn-icon-round:hover {
  transform: scale(1.08);
  background-color: var(--border-color);
}

.btn-icon-round.copied-feedback {
  width: auto;
  padding: 0 14px;
  gap: 6px;
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--text-white);
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-danger-hover:hover {
  background-color: var(--danger);
  color: var(--text-white);
  border-color: var(--danger);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--border-radius-md);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-full);
  transition: all var(--transition-fast);
}

.close-btn:hover {
  background-color: var(--border-color);
  color: var(--text-main);
}

/* Header Styling */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 5%;
  background-color: var(--bg-nav);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: var(--glass-blur);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.logo-icon {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.logo-text span {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background-color: var(--border-color);
  color: var(--text-main);
}

/* Theme Toggle Icon Behaviors */
.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }
.dark-theme .theme-toggle .sun-icon { display: block; }
.dark-theme .theme-toggle .moon-icon { display: none; }

/* Main Container */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 5%;
}

/* Hero & Input Bar Section */
.scraping-hero {
  text-align: center;
  margin-bottom: 50px;
  animation: fadeIn 0.8s ease-out;
}

.hero-content h1 {
  font-size: 2.8rem;
  line-height: 1.15;
  margin-bottom: 12px;
  color: var(--text-main);
}

.hero-content p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 30px auto;
  line-height: 1.6;
}

.url-input-form {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.url-input-form .input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  background-color: var(--bg-card);
  padding: 4px;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

.url-input-form .input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.input-icon {
  position: absolute;
  left: 18px;
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.url-input-form input {
  width: 100%;
  padding: 16px 16px 16px 52px;
  background: transparent;
  border: none;
  font-size: 1.02rem;
  color: var(--text-main);
  outline: none;
}

.url-input-form input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.hero-buttons-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-buttons-group .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.hero-buttons-group .btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Recipes Dashboard Library */
.library-section {
  border-top: 1px solid var(--border-color);
  padding-top: 40px;
}

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

.section-title {
  font-size: 1.8rem;
  color: var(--text-main);
}

.filter-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

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

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
}

.search-wrapper input {
  padding: 10px 14px 10px 42px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  outline: none;
  font-size: 0.95rem;
  width: 260px;
  transition: all var(--transition-fast);
}

.search-wrapper input:focus {
  border-color: var(--primary);
  width: 320px;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Grid layout of recipes */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

/* Recipe Card Styling */
.recipe-card {
  background-color: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.recipe-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: hsl(var(--hue-primary), 40%, 30%);
}

.recipe-card-img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 68%; /* aspect ratio */
  background-color: var(--border-color);
  overflow: hidden;
}

.recipe-card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.recipe-card:hover .recipe-card-img {
  transform: scale(1.05);
}

.recipe-card-img-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 10px;
  background: linear-gradient(135deg, var(--bg-card), var(--border-color));
}

.recipe-card-img-placeholder i {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}

.recipe-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.recipe-card-origin {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 6px;
}

.recipe-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-card-meta {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.recipe-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.recipe-card-meta span i {
  width: 14px;
  height: 14px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  animation: fadeIn var(--transition-normal);
}

.empty-icon {
  background-color: var(--border-color);
  width: 80px;
  height: 80px;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--text-muted);
}

.empty-icon i {
  width: 36px;
  height: 36px;
}

.empty-state h3 {
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-state p {
  max-width: 340px;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Modal Overlay Framework */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  backdrop-filter: blur(4px);
  padding: 20px;
}

/* Modal Stacking Z-Index Hierarchy */
#detail-modal { z-index: 1000; }
#save-modal { z-index: 1100; }
#admin-create-user-modal { z-index: 1150; }
#admin-delete-user-modal { z-index: 1160; }
#cooking-mode-modal { z-index: 1200; }
#loading-overlay { z-index: 1300; }
#auth-modal { z-index: 1400; }

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background-color: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  width: 100%;
  max-height: 90vh;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(30px) scale(0.96);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}

.max-width-xs { max-width: 420px; }
.max-width-lg { max-width: 850px; }
.max-width-xl { max-width: 1100px; }
.no-padding { padding: 0; }

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

.modal-header h3 {
  font-size: 1.4rem;
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: var(--bg-app);
}

/* Form Styles inside Modals */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

@media (max-width: 768px) {
  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* AI Polish Suggestion Banner */
.ai-polish-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 20px;
  background-color: hsla(var(--hue-secondary), 100%, 51%, 0.08);
  border: 1px solid hsla(var(--hue-secondary), 100%, 51%, 0.25);
  border-radius: var(--border-radius-md);
  animation: fadeIn 0.3s ease-out;
}

.ai-polish-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-polish-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-full);
  background-color: hsla(var(--hue-secondary), 100%, 51%, 0.18);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-polish-icon i,
.ai-polish-icon svg {
  width: 18px;
  height: 18px;
}

.ai-polish-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-polish-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
}

.ai-polish-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.ai-polish-banner.success {
  background-color: hsla(118, 19%, 43%, 0.1);
  border-color: hsla(118, 19%, 43%, 0.3);
}

.ai-polish-banner.success .ai-polish-icon {
  background-color: hsla(118, 19%, 43%, 0.2);
  color: var(--accent);
}

@media (max-width: 640px) {
  .ai-polish-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
  font-family: var(--font-heading);
}

.form-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="password"],
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-app);
  color: var(--text-main);
  outline: none;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus,
.form-group input[type="password"]:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.custom-img-url-wrapper {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 2px;
}

.custom-img-url-wrapper input {
  padding: 10px 10px 10px 42px;
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  color: var(--text-main);
}

/* Image Selection Gallery */
.image-gallery-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  max-height: 230px;
  overflow-y: auto;
  padding: 4px;
  background-color: var(--bg-app);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
}

.image-option {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  background-color: var(--border-color);
}

.image-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-option:hover {
  transform: scale(0.96);
  opacity: 0.9;
}

.image-option.selected {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.image-option.selected::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: var(--primary);
  color: var(--text-white);
  width: 18px;
  height: 18px;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

/* Interactive Detail Viewer Modal */
.detail-hero-banner {
  height: 380px;
  position: relative;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 30px 40px;
}

.detail-hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.85) 100%);
}

.detail-back-btn {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: var(--text-white);
  padding: 8px 16px;
  border-radius: var(--border-radius-full);
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  transition: all var(--transition-fast);
}

.detail-back-btn:hover {
  background-color: rgba(0, 0, 0, 0.7);
  transform: translateX(-3px);
}

.detail-actions {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  gap: 12px;
}

.detail-main-content {
  background-color: var(--bg-card);
  padding: 40px;
  overflow-y: auto;
  flex-grow: 1;
}

@media (max-width: 768px) {
  .detail-hero-banner { height: 240px; }
  .detail-main-content { padding: 20px; }
}

.detail-header-info {
  margin-bottom: 30px;
}

#recipe-detail-title {
  font-size: 2.2rem;
  color: var(--text-main);
  margin-bottom: 12px;
}

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

.recipe-meta-tags span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  background-color: var(--bg-app);
  padding: 6px 14px;
  border-radius: var(--border-radius-full);
  border: 1px solid var(--border-color);
}

.recipe-meta-tags span .val {
  font-weight: 600;
  color: var(--text-main);
}

.recipe-meta-tags span i {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.recipe-detail-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Scaler panel & cooking trigger */
.servings-scaler-panel {
  display: flex;
  align-items: center;
  background-color: var(--bg-app);
  padding: 14px 24px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 35px;
  flex-wrap: wrap;
  gap: 20px;
}

.scale-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.scaler-controls {
  display: flex;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-full);
  padding: 4px;
}

.scaler-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-full);
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.scaler-btn:hover {
  background-color: var(--border-color);
}

.scaler-val {
  font-weight: 700;
  font-size: 1rem;
  padding: 0 14px;
  min-width: 44px;
  text-align: center;
}

.cooking-mode-trigger {
  margin-left: auto;
}

@media (max-width: 768px) {
  .cooking-mode-trigger {
    width: 100%;
    margin-left: 0;
  }
}

/* Split layout inside detail modal */
.detail-split-layout {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 50px;
}

@media (max-width: 992px) {
  .detail-split-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.detail-ingredients-column h3,
.detail-instructions-column h3 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.section-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Ingredients Checklist */
.ingredients-check-list {
  list-style: none;
}

.ingredient-checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

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

.checkbox-custom {
  margin-top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0.75rem;
  font-weight: 800;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  background-color: var(--bg-card);
}

.ingredient-checkbox-item:hover .checkbox-custom {
  border-color: var(--primary);
}

.ingredient-checkbox-item.checked .checkbox-custom {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--text-white);
}

.ingredient-text {
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

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

/* Instructions lists */
.instructions-progress-list {
  list-style: none;
}

.instruction-step-item {
  position: relative;
  padding-left: 45px;
  padding-bottom: 26px;
  cursor: pointer;
}

.instruction-step-item:last-child {
  padding-bottom: 0;
}

/* Connector Line */
.instruction-step-item::after {
  content: '';
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: 0;
  width: 2px;
  background-color: var(--border-color);
  z-index: 1;
}

.instruction-step-item:last-child::after {
  display: none;
}

.step-number-bullet {
  position: absolute;
  left: 0;
  top: 2px;
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-full);
  background-color: var(--bg-app);
  border: 2px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 2;
  transition: all var(--transition-fast);
}

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

.instruction-step-item.active .step-number-bullet {
  border-color: var(--primary);
  background-color: var(--primary);
  color: var(--text-white);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.instruction-step-item.checked .step-number-bullet {
  border-color: var(--accent);
  background-color: var(--accent);
  color: var(--text-white);
}

.step-text-block {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.instruction-step-item.checked .step-text-block {
  color: var(--text-muted);
}

/* Header style instructions (e.g. ### Sauce) */
.instruction-step-item.section-header-step {
  padding-left: 0;
  padding-top: 15px;
  padding-bottom: 12px;
  cursor: default;
}

.instruction-step-item.section-header-step::after {
  left: 0;
}

.instruction-step-item.section-header-step .step-text-block {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary);
}

.instruction-step-item.section-header-step .step-number-bullet {
  display: none;
}

/* Fullscreen Cooking Mode */
.cooking-mode-overlay {
  background-color: hsl(var(--hue-neutral), 40%, 6%);
  padding: 0;
}

.cooking-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-white);
}

.cooking-header {
  padding: 20px 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cooking-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
}

.cooking-title-indicator {
  font-weight: 600;
  font-size: 1rem;
  opacity: 0.8;
  max-width: 30%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stopwatch inside Cooking mode */
.cook-timer-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 16px;
  border-radius: var(--border-radius-full);
}

.timer-display {
  font-family: monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

.timer-btn {
  background: none;
  border: none;
  color: var(--text-white);
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.timer-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.color-white {
  color: var(--text-white) !important;
}

/* Large Stepper card for focused view */
.cooking-stepper-box {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 900px;
  width: 90%;
  margin: 0 auto;
  padding: 40px 0;
}

.step-progress-track {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-full);
  overflow: hidden;
  margin-bottom: 50px;
}

.step-progress-bar {
  height: 100%;
  background-color: var(--primary);
  width: 20%;
  border-radius: var(--border-radius-full);
  transition: width var(--transition-normal);
}

.cooking-slide {
  text-align: center;
  animation: slideIn var(--transition-normal) ease-out;
}

.cooking-step-badge {
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 8px 20px;
  border-radius: var(--border-radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-family: var(--font-heading);
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 30px;
}

.cooking-step-text {
  font-size: 2.2rem;
  line-height: 1.5;
  font-weight: 500;
  max-width: 800px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .cooking-step-text { font-size: 1.6rem; }
  .cooking-header { padding: 15px 20px; }
}

.cooking-controls {
  padding: 30px 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: var(--border-radius-full);
  background-color: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dot.active {
  background-color: var(--primary);
  transform: scale(1.3);
}

/* Full Loading / Scraping Overlay */
.loading-overlay {
  background-color: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
}

.loader-card {
  background-color: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  padding: 40px;
  text-align: center;
  max-width: 440px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spinner-outer {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 24px auto;
}

.spinner-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-full);
  border: 4px solid var(--border-color);
  border-top-color: var(--primary);
  border-bottom-color: var(--secondary);
  animation: spin 1.2s linear infinite;
}

.spinner-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.loader-card h3 {
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

.loader-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.loader-steps {
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.loader-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  background-color: transparent;
  transition: all var(--transition-fast);
}

.loader-step i {
  width: 18px;
  height: 18px;
}

.loader-step.active {
  color: var(--primary);
  background-color: var(--bg-app);
  font-weight: 600;
}

.loader-step.completed {
  color: var(--accent);
}

.loader-step.completed i {
  color: var(--accent);
}

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

@keyframes scaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

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

.spinning-icon {
  animation: spin 2s linear infinite;
}

/* User Badge & Logout in Header */
.user-badge-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 4px 6px 4px 12px;
  border-radius: var(--border-radius-full);
  backdrop-filter: var(--glass-blur);
}

.user-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
}

.user-display i {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

#btn-logout {
  width: 32px;
  height: 32px;
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

#btn-logout:hover {
  background-color: var(--danger);
  color: var(--text-white);
  border-color: var(--danger);
}

/* Dashboard Tabs Navigation */
.dashboard-tabs {
  display: flex;
  gap: 8px;
  background-color: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 6px;
  border-radius: var(--border-radius-md);
  backdrop-filter: var(--glass-blur);
}

.dashboard-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.dashboard-tab-btn i {
  width: 16px;
  height: 16px;
}

.dashboard-tab-btn:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.dashboard-tab-btn.active {
  color: var(--text-white);
  background-color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Auth Modal Overlay & Cards */
.auth-modal-box {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--border-radius-lg);
}

.auth-logo {
  text-align: center;
  width: 100%;
}

.auth-logo .logo-icon {
  width: 52px;
  height: 52px;
  font-size: 1.6rem;
  margin: 0 auto 12px auto;
  border-radius: var(--border-radius-md);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.auth-logo h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.auth-logo h2 span {
  color: var(--primary);
}

.auth-logo p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-tabs {
  display: flex;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--border-radius-md);
  margin-bottom: 24px;
}

.auth-tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.auth-tab-btn.active {
  background-color: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.auth-error-alert {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn var(--transition-fast);
}

.auth-error-alert i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-full-width {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
}

/* Custom Checkbox (Public/Private Share Toggle) */
.checkbox-container {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  gap: 10px;
}

.checkbox-container input {
  display: none;
}

.checkbox-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkbox-container input + .checkbox-label::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--bg-app);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.checkbox-container input:checked + .checkbox-label::before {
  background-color: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.checkbox-container:hover input + .checkbox-label::before {
  border-color: var(--primary);
}

/* Card Creator Badge & Community Feeds */
.recipe-card-creator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--border-color);
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  margin-top: 8px;
  max-width: fit-content;
}

.recipe-card-creator i {
  width: 12px;
  height: 12px;
}

/* Glassmorphic border utility classes */
.border-none { border: none !important; }
.pb-0 { padding-bottom: 0 !important; }
.pt-0 { padding-top: 0 !important; }
.mb-3 { margin-bottom: 12px !important; }
.mb-4 { margin-bottom: 16px !important; }
.mb-6 { margin-bottom: 24px !important; }

/* User Admin management page styles */
.admin-panel-container {
  background-color: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  margin-top: 10px;
  animation: fadeIn var(--transition-normal);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.admin-users-table th {
  background-color: var(--bg-app);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-users-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.admin-users-table tr:last-child td {
  border-bottom: none;
}

.admin-users-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

.admin-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.admin-role-badge.admin {
  background-color: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.admin-role-badge.chef {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.btn-danger {
  background-color: var(--danger);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background-color: var(--danger-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.3);
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Original recipe source URL tag styling */
.recipe-meta-tags a#tag-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  background-color: var(--bg-app);
  padding: 6px 14px;
  border-radius: var(--border-radius-full);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.recipe-meta-tags a#tag-source i {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.recipe-meta-tags a#tag-source .val {
  font-weight: 600;
  color: var(--text-main);
}

.recipe-meta-tags a#tag-source:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-glow);
}

.recipe-meta-tags a#tag-source:hover .val {
  color: var(--primary);
}

.admin-role-badge.manager {
  background-color: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #6366f1;
}

/* AI Settings Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.status-badge.configured {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px dashed rgba(16, 185, 129, 0.35);
  color: #10b981;
}
.status-badge.not-configured {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px dashed rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

/* =============================================================
   MOBILE DESIGN AND NAVIGATION UPGRADES (HIGH FIDELITY UX)
   ============================================================= */

/* Layout adaptation variables */
:root {
  --bottom-nav-height: 68px;
  --fab-size: 56px;
}

/* Default Mobile Elements Hidden on Desktop */
.mobile-header-group,
.bottom-sheet-handle,
.profile-avatar-large {
  display: none;
}

/* Mobile responsive media queries */
@media (max-width: 768px) {
  /* Define layout safe offsets */
  body {
    padding-bottom: 0 !important;
  }

  /* Compact Header */
  .app-header {
    padding: 12px 16px;
    height: 60px;
  }
  
  .logo-text {
    font-size: 1.25rem;
  }
  
  .logo-icon {
    width: 34px;
    height: 34px;
  }

  /* Hide desktop action buttons in header */
  .app-header #btn-manual-add,
  .app-header .user-badge-container,
  .app-header #tab-user-admin {
    display: none !important;
  }

  /* Compact Hero */
  .app-container {
    padding: 16px 16px 40px 16px;
  }
  
  .scraping-hero {
    margin-bottom: 24px;
    padding: 0 8px;
  }
  
  .hero-content h1 {
    font-size: 1.8rem;
    line-height: 1.2;
  }
  
  .hero-content p {
    font-size: 0.9rem;
    margin-bottom: 16px;
  }
  
  .url-input-form {
    flex-direction: column;
    padding: 0;
    gap: 10px;
  }
  
  .url-input-form .input-wrapper {
    padding: 2px;
    border-radius: var(--border-radius-md);
  }

  .url-input-form input {
    padding: 12px 12px 12px 42px;
    font-size: 0.92rem;
  }
  
  .hero-buttons-group {
    width: 100%;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .hero-buttons-group button {
    flex: 1 1 calc(50% - 6px);
    height: 42px;
    font-size: 0.88rem;
    padding: 8px 12px;
  }

  .hero-buttons-group button#btn-scrape-submit {
    flex: 1 1 100%;
  }

  /* Hide desktop dashboard tab bar */
  .library-header {
    margin-bottom: 16px;
  }
  
  .dashboard-tabs {
    display: none !important;
  }
  
  .search-wrapper {
    width: 100%;
  }
  
  .search-wrapper input {
    width: 100% !important;
    height: 44px;
    font-size: 0.95rem;
  }

  /* fluid grids */
  .recipes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .recipe-card {
    border-radius: var(--border-radius-md);
  }
  
  .recipe-card-content {
    padding: 10px;
  }
  
  .recipe-card-origin {
    font-size: 0.65rem;
    margin-bottom: 2px;
  }
  
  .recipe-card-title {
    font-size: 0.9rem;
    margin-bottom: 4px;
    line-height: 1.25;
  }
  
  .recipe-card-creator {
    font-size: 0.65rem;
    padding: 2px 6px;
    margin-top: 2px;
    margin-bottom: 4px;
  }
  
  .recipe-card-desc {
    display: none !important;
  }
  
  .recipe-card-meta {
    padding-top: 6px;
    gap: 8px;
    font-size: 0.7rem;
  }

  /* Bottom Navigation Styles */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: var(--bottom-nav-height);
    background-color: var(--glass-bg);
    border-top: 1px solid var(--border-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    z-index: 990;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  }
  
  .mobile-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.75rem;
    gap: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex: 1;
    height: 100%;
  }
  
  .mobile-tab-item i,
  .mobile-tab-item svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
  }
  
  .mobile-tab-item:active i,
  .mobile-tab-item:active svg {
    transform: scale(0.88);
  }
  
  .mobile-tab-item.active {
    color: var(--primary);
    font-weight: 700;
  }

  /* Floating Action Button */
  .fab-add-recipe {
    display: flex;
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px + env(safe-area-inset-bottom));
    right: 16px;
    width: var(--fab-size);
    height: var(--fab-size);
    border-radius: var(--border-radius-full);
    background-color: var(--primary);
    box-shadow: 0 6px 20px var(--primary-glow);
    border: none;
    color: var(--text-white);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 995;
    transition: all var(--transition-fast);
  }
  
  .fab-add-recipe i,
  .fab-add-recipe svg {
    width: 24px;
    height: 24px;
    transition: transform var(--transition-fast);
  }
  
  .fab-add-recipe:active {
    transform: scale(0.92);
    box-shadow: 0 4px 12px var(--primary-glow);
  }

  /* Adaptive Bottom Sheet Modals */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  
  .modal-box {
    max-height: 88vh;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  .modal-overlay.active .modal-box {
    transform: translateY(0);
  }
  
  /* Bottom Sheet Handle */
  .bottom-sheet-handle {
    display: block;
    width: 40px;
    height: 4px;
    background-color: var(--border-color);
    border-radius: var(--border-radius-full);
    margin: 8px auto 0 auto;
    flex-shrink: 0;
  }
  
  .modal-header {
    padding: 12px 20px 16px 20px;
  }
  
  .modal-body {
    padding: 16px 20px;
  }

  .modal-footer {
    position: sticky;
    bottom: 0;
    flex-shrink: 0;
    z-index: 2;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
  }

  /* Restructure Detail Layout for Single-Column Bottom Sheet */
  .modal-box.max-width-xl {
    max-height: 92vh;
  }
  
  .detail-hero-banner {
    height: 200px;
    border-radius: 0;
  }
  
  .detail-main-content {
    padding: 16px 20px;
  }
  
  .detail-header-info h2 {
    font-size: 1.6rem;
  }
  
  .recipe-meta-tags {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .recipe-meta-tags span,
  .recipe-meta-tags a#tag-source {
    font-size: 0.8rem;
    padding: 4px 10px;
  }
  
  .servings-scaler-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
    background-color: var(--bg-app);
    border-radius: var(--border-radius-md);
  }
  
  .cooking-mode-trigger {
    width: 100%;
  }
  
  .detail-split-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 16px;
  }
  
  /* Interactive Cooking Mode adjustments */
  .cooking-container {
    padding: 16px;
  }
  
  .cooking-header {
    padding-bottom: 12px;
  }
  
  .cooking-title-indicator {
    font-size: 1.1rem;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .cook-timer-panel {
    gap: 4px;
  }
  
  .timer-display {
    font-size: 1rem;
  }
  
  .timer-btn {
    width: 28px;
    height: 28px;
  }
  
  .cooking-stepper-box {
    margin: 20px 0;
    min-height: 240px;
    padding: 24px 16px;
  }
  
  .cooking-step-text {
    font-size: 1.35rem;
    line-height: 1.45;
  }
  
  .cooking-controls {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .cooking-controls button {
    width: 100%;
    height: 48px;
  }
  
  .cooking-controls .step-dots {
    justify-content: center;
    order: -1;
    margin-bottom: 8px;
  }

  /* Large Mobile Profile Style sheet */
  .profile-avatar-large {
    display: flex;
    width: 72px;
    height: 72px;
    border-radius: var(--border-radius-full);
    background: linear-gradient(135deg, var(--primary-glow), var(--border-color));
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
  }
  
  .profile-avatar-large i,
  .profile-avatar-large svg {
    width: 32px;
    height: 32px;
  }
  
  /* Tap animations */
  .btn:active,
  .recipe-card:active,
  .image-option:active {
    transform: scale(0.97);
  }
  
  .ingredient-checkbox-item {
    min-height: 44px;
    padding: 10px 12px;
  }

  /* Consolidated header navigation for mobile */
  .mobile-header-group {
    display: flex !important;
    align-items: center;
    gap: 6px;
  }
  
  .mobile-header-tab,
  .mobile-header-btn-add {
    width: 38px;
    height: 38px;
    border-radius: var(--border-radius-full);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
  }
  
  .mobile-header-tab i,
  .mobile-header-tab svg,
  .mobile-header-btn-add i,
  .mobile-header-btn-add svg {
    width: 16px;
    height: 16px;
  }
  
  .mobile-header-tab:active,
  .mobile-header-btn-add:active {
    transform: scale(0.92);
  }
  
  .mobile-header-tab.active {
    color: var(--primary);
    background-color: var(--primary-glow);
    border-color: hsla(var(--hue-primary), 95%, 52%, 0.25);
    font-weight: 700;
  }
  
  .mobile-header-btn-add {
    background-color: var(--primary);
    color: var(--text-white);
    border: none;
    box-shadow: 0 4px 10px var(--primary-glow);
  }
  
  /* Library dynamic view header title */
  .library-view-title {
    display: block !important;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 18px;
    font-family: var(--font-heading);
    letter-spacing: -0.01em;
  }

  /* Prevent mobile recipe detail header button overlaps */
  .detail-back-btn span,
  #btn-detail-clone span {
    display: none !important;
  }
  
  .detail-back-btn {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: var(--border-radius-full) !important;
    top: 16px !important;
    left: 16px !important;
  }
  
  #btn-detail-clone {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border-radius: var(--border-radius-full) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
  }
  
  .detail-actions {
    top: 16px !important;
    right: 16px !important;
    gap: 8px !important;
  }
}

/* =============================================================
   SHOPPING LISTS WORKSPACE & CONTROLS
   ============================================================= */

.shopping-badge {
  background-color: var(--primary);
  color: var(--text-white);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--border-radius-full);
  margin-left: 4px;
  line-height: 1.2;
}

.shopping-badge-mobile {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--primary);
  color: var(--text-white);
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.85rem;
  border-radius: var(--border-radius-sm);
}

.btn-danger-text:hover {
  border-color: var(--danger);
  color: var(--danger);
  background-color: rgba(239, 68, 68, 0.1);
}

.shopping-panel-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.shopping-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
}

.shopping-list-selector-group,
.shopping-share-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.shopping-select-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.shopping-select-label i,
.shopping-select-label svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.shopping-select {
  background-color: var(--bg-app);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.shopping-select:focus {
  border-color: var(--primary);
}

.shopping-select-sm {
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 500;
}

.shopping-stats-pill {
  background: rgba(99, 102, 241, 0.12);
  border: 1px dashed rgba(99, 102, 241, 0.3);
  color: #6366f1;
  padding: 5px 10px;
  border-radius: var(--border-radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.shopping-stats-pill i,
.shopping-stats-pill svg {
  width: 14px;
  height: 14px;
}

.shopping-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.shopping-add-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 280px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 6px 6px 6px 14px;
}

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

.shopping-add-form input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  width: 100%;
  font-size: 0.95rem;
  padding: 8px 0;
}

.shopping-view-toggles {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.shopping-consolidate-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  user-select: none;
}

.shopping-consolidate-toggle input {
  display: none;
}

.shopping-consolidate-toggle .toggle-track {
  width: 34px;
  height: 18px;
  background-color: var(--border-color);
  border-radius: var(--border-radius-full);
  position: relative;
  transition: background-color var(--transition-fast);
}

.shopping-consolidate-toggle .toggle-thumb {
  width: 14px;
  height: 14px;
  background-color: var(--text-white);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform var(--transition-fast);
}

.shopping-consolidate-toggle input:checked + .toggle-track {
  background-color: var(--primary);
}

.shopping-consolidate-toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(16px);
}

.shopping-consolidate-toggle .toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.shopping-aisles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  align-items: start;
}

.shopping-category-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.shopping-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: var(--bg-app);
  border-bottom: 1px solid var(--border-color);
}

.shopping-category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.shopping-category-title i,
.shopping-category-title svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.shopping-category-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--bg-card);
  padding: 2px 8px;
  border-radius: var(--border-radius-full);
  border: 1px solid var(--border-color);
}

.shopping-items-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.shopping-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

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

.shopping-item-row:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.shopping-item-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
}

.shopping-item-row.checked .shopping-item-text {
  text-decoration: line-through;
  color: var(--text-muted);
  opacity: 0.6;
}

.shopping-item-row.checked .checkbox-custom {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--text-white);
}

.shopping-item-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.shopping-item-text {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.35;
}

.shopping-item-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.shopping-source-tag {
  font-size: 0.7rem;
  color: var(--primary);
  background: rgba(251, 146, 60, 0.12);
  border: 1px solid rgba(251, 146, 60, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.shopping-item-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0.5;
  transition: all var(--transition-fast);
}

.shopping-item-delete:hover {
  opacity: 1;
  color: var(--danger);
  background-color: rgba(239, 68, 68, 0.1);
}

.shopping-item-delete i,
.shopping-item-delete svg {
  width: 15px;
  height: 15px;
  display: block;
}

.detail-ingredients-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-add-to-list-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .shopping-aisles-grid {
    grid-template-columns: 1fr;
  }
  .shopping-header-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .shopping-list-selector-group,
  .shopping-share-group {
    width: 100%;
    justify-content: space-between;
  }
  .shopping-select {
    flex: 1;
  }
  .detail-ingredients-header {
    flex-direction: column;
    align-items: stretch;
  }
  .detail-add-to-list-bar {
    width: 100%;
  }
  .detail-add-to-list-bar select {
    flex: 1;
  }
}

/* =============================================================
   ADMIN BACKUP & RECOVERY CONSOLE STYLES
   ============================================================= */

.backup-top-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.backup-quick-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.backup-status-alert {
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-color);
}

.backup-status-alert.success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.backup-status-alert.error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--danger);
}

.backup-status-alert.info {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  color: #818cf8;
}

.backup-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.backup-config-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.backup-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
}

.backup-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.backup-card-title i,
.backup-card-title svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.backup-card-title h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.backup-save-bar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

@media (max-width: 768px) {
  .backup-config-grid {
    grid-template-columns: 1fr;
  }
  .backup-quick-actions {
    width: 100%;
  }
  .backup-quick-actions button {
    flex: 1;
  }
}
