:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-bg: #eff6ff;
  --bg-app: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: 'Noto Sans KR', 'Outfit', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  overflow: hidden; /* Prevent body scroll, use app-content scroll */
  overscroll-behavior: none; /* iOS scroll bounce prevent */
  user-select: none; /* Make it feel more like an app */
}

h1, h2, h3 {
  font-family: 'Outfit', 'Noto Sans KR', sans-serif;
  margin: 0;
}

/* App Layout */
.app-body {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(90px + env(safe-area-inset-bottom)); /* Safe area support */
  -webkit-overflow-scrolling: touch;
}

.view {
  display: none;
  padding: 0 20px 24px; /* Removed top padding, handled by sticky header */
  animation: fadeIn 0.3s ease-out;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Headers */
.sticky-top-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-app);
  margin: 0 -20px;
  padding: 0 20px 0; /* Safe area is handled by the ad container */
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 10px; /* Reduced top padding to minimize gap with ad */
  background: transparent;
}

.view-header h1 {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.search-container {
  margin-bottom: 8px;
}

.search-box {
  background: white;
  border-radius: 16px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
  transition: all 0.2s;
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box svg {
  color: var(--text-muted);
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 0;
  font-size: 15px;
  outline: none;
}

/* Buttons */
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: none;
  background: var(--card-bg);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:active {
  transform: scale(0.95);
  background: var(--border);
}

.primary-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.primary-btn:active {
  background: var(--primary-dark);
}

.secondary-btn {
  background: #f1f5f9;
  color: #475569;
  border: none;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.text-btn {
  background: transparent;
  border: none;
  color: var(--danger);
  font-weight: 700;
  cursor: pointer;
}

/* Category Chips */
.category-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  background: transparent;
  padding: 10px 0 20px;
  margin-bottom: 8px;
}

.category-scroll::-webkit-scrollbar {
  display: none;
}

.category-chip {
  padding: 8px 16px;
  border-radius: 50px;
  background: white;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  display: flex;
  align-items: center;
  gap: 6px;
}

.count-badge {
  font-size: 11px;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 800;
  transition: all 0.2s;
}

.category-chip.active .count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.category-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.category-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.favorite-chip.active {
  background: #facc15;
  border-color: #facc15;
  color: #854d0e;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3);
}

.favorite-chip.active .count-badge {
  background: rgba(255, 255, 255, 0.4);
  color: #854d0e;
}

/* Food List */
.food-list {
  display: grid;
  gap: 12px;
}

.food-item {
  background: var(--card-bg);
  padding: 18px;
  border-radius: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.03);
  border: 1px solid rgba(226, 232, 240, 0.5);
  transition: all 0.3s ease;
}

.food-item:hover {
  transform: scale(1.01) translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  border-color: var(--primary-bg);
}

.food-item.warning {
  border-left: 4px solid var(--warning);
}

.food-item.expired {
  border-left: 4px solid var(--danger);
}

.food-name {
  font-weight: 700;
  font-size: 16px;
}

.food-expiry {
  font-size: 13px;
  color: var(--text-muted);
}

.food-actions {
  display: flex;
  gap: 8px;
}

.food-actions button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.edit-btn { 
  background: var(--primary-bg); 
  color: var(--primary); 
}

.delete-btn { 
  background: #fee2e2; 
  color: var(--danger); 
}

.edit-btn:active, .delete-btn:active {
  transform: scale(0.9);
}

.favorite-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d1d5db;
  transition: all 0.2s;
}

.favorite-btn:hover {
  transform: scale(1.2);
}

.favorite-btn.active {
  color: #facc15; /* Yellow-400 */
  filter: drop-shadow(0 0 2px rgba(234, 179, 8, 0.3));
}

.star-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(80px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px env(safe-area-inset-bottom);
  z-index: 1000;
  box-shadow: 0 -5px 20px rgba(0,0,0,0.03);
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
}

.nav-item svg {
  width: 24px;
  height: 24px;
}

.nav-item span {
  font-size: 11px;
  font-weight: 700;
}

.nav-item.active {
  color: var(--primary);
}

.nav-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background-color: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  padding: 0 4px;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.3);
}

/* Recipes */
.recipe-grid {
  display: grid;
  gap: 20px;
}

.recipe-card {
  background: var(--card-bg);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.03);
  display: flex;
  align-items: center;
  padding: 12px;
  gap: 16px;
}

.recipe-img-placeholder {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.recipe-info h3 { font-size: 17px; margin-bottom: 4px; }
.recipe-info p { font-size: 13px; color: var(--text-muted); margin: 0; }

/* Settings */
.settings-group {
  margin-bottom: 20px;
}

.settings-group label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  margin-left: 4px;
}

.settings-card {
  background: white;
  border-radius: 20px;
  padding: 8px 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.code-with-share, .nickname-with-edit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.profile-row:last-child { border-bottom: none; }

.profile-row .label { color: var(--text-muted); font-size: 15px; }

.participation-box {
  background: white;
  border-radius: 16px;
  padding: 6px;
  display: flex;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.participation-box input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 16px;
  font-size: 16px;
  outline: none;
}

.participation-box .primary-btn {
  padding: 12px 20px;
  border-radius: 12px;
}

/* Fridge Management List Style */
.fridge-management-list {
  padding: 0 !important;
}

.fridge-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.fridge-list-item:last-child {
  border-bottom: none;
}

.fridge-info-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fridge-icon-badge {
  width: 32px;
  height: 32px;
  background: var(--primary-bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.fridge-owner-name {
  font-weight: 700;
  font-size: 15px;
}

.fridge-tag {
  font-size: 11px;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-muted);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-top: 2px;
}

.switch-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

.switch-btn.current {
  background: var(--primary);
  color: white;
  cursor: default;
}

.switch-btn:hover:not(.current) {
  background: #dbeafe;
}

.trash-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trash-btn:hover {
  background: #fee2e2;
  color: var(--danger);
}

.fridge-actions-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Memo Styles */
.memo-list {
  display: grid;
  gap: 16px;
  padding-bottom: 20px;
}

.memo-card {
  background: white;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
  border: 1px solid var(--border);
  position: relative;
  animation: fadeIn 0.3s ease-out;
}

.memo-content {
  font-size: 16px;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 12px;
  line-height: 1.6;
}

.memo-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.memo-date {
  font-weight: 400;
}

.memo-actions {
  display: flex;
  gap: 8px;
}

.memo-action-btn {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.memo-edit-btn { color: var(--primary); background: var(--primary-bg); }
.memo-delete-btn { color: var(--danger); background: #fee2e2; }
.memo-edit-btn:hover { background: #dbeafe; }
.memo-delete-btn:hover { background: #fecaca; }

/* Request Styles */
.request-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.request-item:last-child { border-bottom: none; }

.request-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.request-requester {
  font-weight: 700;
  font-size: 15px;
}

.request-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.request-actions {
  display: flex;
  gap: 8px;
}

.btn-xs {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  border: none;
}

.btn-approve { background: var(--primary); color: white; }
.btn-reject { background: #f1f5f9; color: var(--text-muted); }

.status-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 50px;
  font-weight: 700;
}

.status-pending { background: #fef9c3; color: #854d0e; }
.status-approved { background: #dcfce7; color: #166534; }
.status-rejected { background: #fee2e2; color: #991b1b; }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal-container {
  background: white;
  width: 100%;
  max-width: 450px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.15);
  animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  font-size: 28px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body { padding: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.form-group input, .form-group select {
  width: 100%;
  height: 52px; /* Fixed height for consistency */
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-app);
  font-size: 16px; /* Prevents iOS zoom */
  font-family: inherit;
  color: var(--text-main);
  box-sizing: border-box;
  -webkit-appearance: none; /* Mobile Safari consistency */
  -moz-appearance: none;
  appearance: none;
}

/* Custom Arrow for select on iOS/Modern Browsers */
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

.form-group input[type="date"] {
  position: relative;
  min-height: 52px;
}

/* Ensure date input displays content properly on iOS */
.form-group input[type="date"]::-webkit-inner-spin-button,
.form-group input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}

.modal-footer {
  padding: 0 24px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Utils */
.w-full { width: 100%; }

/* Auth Pages Styling (Restored and Improved) */
.page-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
}

.auth-panel {
  background: white;
  width: 100%;
  max-width: 440px;
  padding: 40px;
  border-radius: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.5s ease-out;
}

@media (max-width: 480px) {
  .auth-panel {
    padding: 30px 24px;
    border-radius: 24px;
  }
}

.brand-area {
  text-align: center;
  margin-bottom: 20px;
}

.brand-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: inline-block;
}

.brand-logo {
  width: 100px;
  height: auto;
  margin-bottom: 8px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 480px) {
  .brand-logo {
    width: 80px;
  }
}

.brand-area h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.brand-area p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
  word-break: keep-all;
}

.auth-form h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.auth-form p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.input-label {
  display: block;
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
}

.input-label input {
  width: 100%;
  margin-top: 6px;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  font-size: 16px;
  transition: all 0.2s;
  box-sizing: border-box;
}

.input-label input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  border: none;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  margin-top: 4px;
}

.form-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-muted);
}

.form-footer a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  margin-left: 4px;
}

.feedback {
  margin-top: 16px;
  font-size: 14px;
  text-align: center;
  min-height: 20px;
}

.feedback.error { color: var(--danger); }
.feedback.success { color: var(--success); }

/* Participation Display in Profile Setup */
.participation-code-display {
  background: var(--primary-bg);
  padding: 16px;
  border-radius: 16px;
  margin-bottom: 24px;
  text-align: center;
}

.participation-code-display p { margin: 0; font-weight: 700; color: var(--primary); }
.participation-code-display span { font-size: 20px; letter-spacing: 2px; }
.participation-code-display small { display: block; margin-top: 4px; color: var(--text-muted); }

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
  display: none; /* Changed via JS */
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: opacity 0.3s ease;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid var(--primary-bg);
  border-top: 5px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Modal and Page animations improve */
.modal-overlay {
  background: rgba(15, 23, 42, 0.4); /* Darker backdrop */
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 100px; /* Above the bottom nav */
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: white;
  color: var(--text-main);
  padding: 12px 20px;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  width: calc(100% - 48px);
  max-width: 500px;
  animation: toastIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), toastOut 0.3s 2.7s forwards;
  pointer-events: auto;
  border: 1px solid var(--border);
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(20px) scale(0.9); }
}

/* Loading Overlay fix */
.loading-overlay {
  z-index: 9998;
}

.badge-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background-color: var(--danger);
  border: 2px solid white;
  border-radius: 50%;
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Shopping List Styles */
.shopping-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  padding: 16px 20px;
  border-radius: 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
  margin-bottom: 12px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.shopping-item.purchased {
  opacity: 0.6;
  background: #f8fafc;
}

.shopping-item.purchased .shopping-item-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.shopping-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.shopping-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.shopping-item.purchased .shopping-checkbox {
  background: var(--success);
  border-color: var(--success);
}

.shopping-checkbox svg {
  color: white;
  display: none;
}

.shopping-item.purchased .shopping-checkbox svg {
  display: block;
}

.shopping-item-name {
  font-weight: 700;
  font-size: 16px;
}

.shopping-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.shopping-item-actions {
  display: flex;
  gap: 8px;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(59, 130, 246, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
