/* ============================================
   OGExpiry Shelf - Web App Styles
   Mobile-first design matching the screenshots
   ============================================ */

:root {
  --bg-primary: #fafaf8;
  --bg-secondary: #f5f5f4;
  --bg-card: #ffffff;
  --bg-dark: #0c0a09;
  
  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #a8a29e;
  --text-light: #78716c;
  
  --green: #22c55e;
  --green-light: #dcfce7;
  --green-bg: #f0fdf4;
  
  --orange: #f97316;
  --orange-light: #ffedd5;
  --orange-bg: #fff7ed;
  
  --red: #ef4444;
  --red-light: #fee2e2;
  --red-bg: #fef2f2;
  
  --blue: #06b6d4;
  --purple: #a855f7;
  
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Dark mode disabled - using light theme only */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
}

/* App Container - Mobile First */
.app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

/* Tablet and up */
@media (min-width: 768px) {
  .app {
    max-width: 600px;
    box-shadow: 0 0 60px rgba(0,0,0,0.15);
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .app {
    max-width: 480px;
    border-radius: 24px;
    height: 90vh;
    margin-top: 5vh;
    box-shadow: 0 25px 80px rgba(0,0,0,0.2);
    overflow: hidden;
  }
}

/* Main Content */
.main-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 16px 100px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  scrollbar-width: none;
}

@media (min-width: 768px) {
  .screen {
    padding: 0 24px 120px;
  }
}

@media (min-width: 1024px) {
  .screen {
    padding: 0 20px 100px;
  }
}

.screen::-webkit-scrollbar {
  display: none;
}

.screen.active {
  opacity: 1;
  visibility: visible;
}

/* Screen Header */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 16px;
  position: relative;
}

.screen-header h1 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.icon-btn {
  position: absolute;
  right: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

/* Stats Row */
.stats-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .stats-row {
    gap: 16px;
  }
}

.stat-card {
  flex: 1;
  padding: 18px 12px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card:active {
  transform: scale(0.96) translateY(2px);
}

.stat-card.expired {
  background: linear-gradient(180deg, var(--red-bg) 0%, #fef2f2 100%);
  border: 1px solid rgba(239, 68, 68, 0.1);
}

.stat-card.expired::before {
  background: linear-gradient(90deg, var(--red), #f87171);
}

.stat-card.soon {
  background: linear-gradient(180deg, var(--orange-bg) 0%, #fff7ed 100%);
  border: 1px solid rgba(249, 115, 22, 0.1);
}

.stat-card.soon::before {
  background: linear-gradient(90deg, var(--orange), #fb923c);
}

.stat-card.total {
  background: linear-gradient(180deg, var(--green-bg) 0%, #f0fdf4 100%);
  border: 1px solid rgba(34, 197, 94, 0.1);
}

.stat-card.total::before {
  background: linear-gradient(90deg, var(--green), #4ade80);
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-num {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.stat-card.expired .stat-num { color: var(--red); }
.stat-card.soon .stat-num { color: var(--orange); }
.stat-card.total .stat-num { color: var(--green); }

/* Section Label */
.section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--green);
  border-radius: 2px;
}

/* Filter Scroll */
.filter-scroll {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: none;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.filter-btn:hover {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.filter-btn.active {
  background: var(--text-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Items List */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  border: 1px solid transparent;
}

.item-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.item-card:active {
  transform: scale(0.98) translateY(0);
}

.item-card.expired {
  border-left: 3px solid var(--red);
}

.item-card.soon {
  border-left: 3px solid var(--orange);
}

.item-card.safe {
  border-left: 3px solid var(--green);
}

.item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.item-card.expired .item-icon {
  background: var(--red-bg);
  color: var(--red);
}

.item-card.soon .item-icon {
  background: var(--orange-bg);
  color: var(--orange);
}

.item-card.safe .item-icon {
  background: var(--green-bg);
  color: var(--green);
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.item-status-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.item-status-badge.expired {
  background: var(--red-bg);
  color: var(--red);
}

.item-status-badge.soon {
  background: var(--orange-bg);
  color: var(--orange);
}

.item-status-badge.safe {
  background: var(--green-bg);
  color: var(--green);
}

.item-status-bar {
  width: 4px;
  height: 40px;
  border-radius: 2px;
  flex-shrink: 0;
}

.item-status-bar.safe { background: var(--green); }
.item-status-bar.soon { background: var(--orange); }
.item-status-bar.expired { background: var(--red); }

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-category {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: capitalize;
}

.item-date {
  display: block;
  font-size: 11px;
  font-weight: 500;
}

.item-date.safe { color: var(--green); }
.item-date.soon { color: var(--orange); }
.item-date.expired { color: var(--red); }

.item-delete {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.item-delete:hover {
  opacity: 1;
}

/* Empty State */
.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state.show {
  display: flex;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-muted);
}

/* FAB - Floating Action Button */
.fab {
  position: absolute;
  bottom: calc(80px + var(--safe-bottom));
  right: 16px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--green) 0%, #16a34a 100%);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 28px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4), 0 2px 4px rgba(34, 197, 94, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 100;
}

.fab:active {
  transform: scale(0.95);
}

/* Tab Bar */
.tab-bar {
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + var(--safe-bottom));
  background: var(--bg-card);
  border-top: 1px solid rgba(0,0,0,0.05);
  z-index: 1000;
  position: relative;
}

@media (min-width: 768px) {
  .tab-bar {
    padding: 12px 0 calc(12px + var(--safe-bottom));
  }
  
  .tab {
    padding: 8px 32px;
  }
  
  .tab span {
    font-size: 12px;
  }
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  min-height: 56px;
  min-width: 64px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  z-index: 1001;
}

.tab:active {
  transform: scale(0.95);
}

.tab svg {
  pointer-events: none;
}

.tab span {
  pointer-events: none;
}

.tab.active {
  color: var(--blue);
}

.tab span {
  font-size: 11px;
  font-weight: 500;
}

/* Analytics Screen */
.analytics-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
  margin-top: 8px;
}

@media (min-width: 768px) {
  .analytics-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .analytics-card {
    padding: 24px;
  }
  
  .analytics-card-value {
    font-size: 32px;
  }
}

.analytics-card {
  padding: 16px 12px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 120px;
  justify-content: center;
}

.analytics-card:active {
  transform: scale(0.98);
}

.analytics-card.primary {
  background: linear-gradient(135deg, var(--green) 0%, #16a34a 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.3);
}

.analytics-card.secondary {
  background: linear-gradient(135deg, var(--blue) 0%, #0891b2 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.3);
}

.analytics-card-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.analytics-card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.analytics-card-label {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.analytics-card-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.analytics-section {
  margin-bottom: 28px;
}

.analytics-section:last-of-type {
  margin-bottom: 20px;
}

.analytics-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.analytics-section-title::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--green);
  border-radius: 2px;
}

/* Category Chart */
.category-chart {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.category-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.category-bar:last-child {
  margin-bottom: 0;
}

.category-bar-label {
  width: 80px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.category-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.category-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-bar-fill.medicine { background: linear-gradient(90deg, #ef4444, #f87171); }
.category-bar-fill.food { background: linear-gradient(90deg, #f97316, #fb923c); }
.category-bar-fill.skincare { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.category-bar-fill.supplement { background: linear-gradient(90deg, #06b6d4, #22d3ee); }

.category-bar-value {
  width: 30px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Timeline Chart */
.timeline-chart {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 16px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 160px;
}

.timeline-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.timeline-bar {
  width: 100%;
  max-width: 36px;
  min-height: 4px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.timeline-bar.expired { background: linear-gradient(180deg, #ef4444, #f87171); }
.timeline-bar.soon { background: linear-gradient(180deg, #f97316, #fb923c); }
.timeline-bar.safe { background: linear-gradient(180deg, #22c55e, #4ade80); }

.timeline-bar-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.timeline-bar-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Insights */
.insights-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.insight-item:active {
  transform: scale(0.99);
}

.insight-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insight-icon.good { background: var(--green-bg); color: var(--green); }
.insight-icon.warning { background: var(--orange-bg); color: var(--orange); }
.insight-icon.danger { background: var(--red-bg); color: var(--red); }
.insight-icon.info { background: var(--bg-secondary); color: var(--blue); }

.insight-content {
  flex: 1;
}

.insight-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.insight-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.analytics-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 20px;
}

.analytics-actions .btn-primary,
.analytics-actions .btn-secondary {
  width: 100%;
}

.btn-primary {
  width: 100%;
  padding: 14px 20px;
  background: var(--green);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 0;
}

.btn-primary:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-secondary {
  width: 100%;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:active {
  transform: scale(0.98);
  background: var(--bg-secondary);
}

/* PDF Screen */
.pdf-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.pdf-stat {
  flex: 1;
  padding: 16px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.pdf-stat-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}

.pdf-stat-num {
  font-size: 22px;
  font-weight: 700;
}

.pdf-stat.expired .pdf-stat-num { color: var(--red); }
.pdf-stat.soon .pdf-stat-num { color: var(--orange); }
.pdf-stat.total .pdf-stat-num { color: var(--green); }

.pdf-info {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  color: var(--text-secondary);
  border: 1px solid rgba(0,0,0,0.05);
}

[data-theme="dark"] .pdf-info {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}

.pdf-info svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--blue);
}

.pdf-info p {
  font-size: 13px;
  line-height: 1.5;
}

.pdf-generate-btn {
  margin-top: 8px;
}

.pdf-preview {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,0.05);
}

.pdf-page {
  border: 1px solid var(--text-light);
  border-radius: var(--radius-sm);
  padding: 20px;
  min-height: 300px;
  background: var(--bg-card);
}

.pdf-page h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.pdf-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.pdf-section {
  margin-bottom: 16px;
}

.pdf-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--text-light);
}

.pdf-section-title.expired { color: var(--red); }
.pdf-section-title.soon { color: var(--orange); }
.pdf-section-title.safe { color: var(--green); }

.pdf-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--bg-secondary);
  color: var(--text-primary);
}

.pdf-item:last-child {
  border-bottom: none;
}

/* Settings Screen */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background 0.15s ease;
}

.setting-item:active {
  background: var(--bg-secondary);
}

.setting-item.danger .setting-title {
  color: var(--red);
}

.setting-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-icon { background: var(--orange-bg); color: var(--orange); }
.feedback-icon { background: var(--green-bg); color: var(--green); }
.delete-icon { background: var(--red-bg); color: var(--red); }

.setting-info {
  flex: 1;
}

.setting-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-value {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.setting-desc {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.setting-arrow {
  color: var(--text-muted);
}

.app-info {
  margin-top: 40px;
  text-align: center;
  padding: 20px;
}

.app-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

/* Disable tab bar when modal is open */
.modal.show ~ .tab-bar,
.modal.show ~ * .tab-bar {
  pointer-events: none;
  opacity: 0.5;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  position: relative;
  width: 100%;
  max-height: 75vh;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px 20px 100px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow-y: auto;
  padding-bottom: calc(100px + var(--safe-bottom));
}

@media (min-width: 768px) {
  .modal-content {
    max-width: 500px;
    border-radius: var(--radius-xl);
    margin: auto;
    transform: scale(0.9);
    opacity: 0;
  }
  
  .modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
  }
}

.modal.show .modal-content {
  transform: translateY(0);
}

.modal-small {
  max-width: 320px;
  margin: auto 20px;
  border-radius: var(--radius-xl);
  transform: scale(0.9);
}

.modal.show .modal-small {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-actions button {
  flex: 1;
}

/* Form */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input {
  padding: 10px 14px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.form-group input:focus {
  outline: none;
  border-color: var(--green);
}

.form-group textarea {
  padding: 10px 14px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--green);
}

/* Privacy Policy Content */
.privacy-content {
  padding: 0 0 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.privacy-content h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 20px 0 8px;
}

.privacy-content h3:first-child {
  margin-top: 0;
}

.privacy-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.privacy-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 24px;
  font-style: italic;
}

/* Privacy icon color */
.privacy-icon {
  background: var(--blue-bg);
  color: var(--blue);
}

.category-select {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.cat-option {
  padding: 10px;
  background: var(--bg-primary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-option span {
  font-size: 24px;
}

.cat-option.active {
  border-color: var(--green);
  background: var(--green-bg);
}

.btn-submit {
  padding: 14px;
  background: var(--green);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-submit:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}

.btn-secondary {
  padding: 12px 20px;
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.btn-danger {
  padding: 12px 20px;
  background: var(--red);
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  color: white;
  cursor: pointer;
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(90px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-icon {
  width: 20px;
  height: 20px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* Animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.item-card {
  animation: slideUp 0.3s ease;
}

/* Desktop optimization */
/* FAB positioning for larger screens */
/* FAB positioning for desktop */
@media (min-width: 1024px) {
  .fab {
    position: absolute;
    bottom: 90px;
    right: 20px;
  }
}

/* Print styles for PDF */
@media print {
  .app {
    box-shadow: none;
  }
  
  .status-bar, .tab-bar, .fab {
    display: none;
  }
}
