/* ===== VARIABLES & RESET ===== */
:root {
  --ocean-deep: #0c4a6e;
  --ocean-mid: #0369a1;
  --ocean-light: #38bdf8;
  --ocean-pale: #e0f2fe;
  --sand: #f5e6c8;
  --sand-light: #fdf6e3;
  --coral: #f97066;
  --palm: #16a34a;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.05);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-height) + 16px);
}

/* ===== HEADER ===== */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(135deg, var(--ocean-deep) 0%, var(--ocean-mid) 100%);
  color: var(--white); padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 12px rgba(12, 74, 110, 0.3);
}
.app-header h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.header-btn {
  background: rgba(255,255,255,0.15); border: none; color: white;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: var(--transition);
}
.header-btn:hover { background: rgba(255,255,255,0.25); }

/* ===== COUNTDOWN ===== */
.countdown-banner {
  background: linear-gradient(135deg, var(--ocean-mid) 0%, var(--ocean-light) 100%);
  padding: 20px; text-align: center; color: white; position: relative; overflow: hidden;
}
.countdown-banner::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
  animation: shimmer 8s ease-in-out infinite;
}
@keyframes shimmer { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(20px, -20px); } }
.countdown-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.9; margin-bottom: 8px; position: relative; }
.countdown-timer { display: flex; justify-content: center; gap: 12px; position: relative; }
.countdown-unit { text-align: center; }
.countdown-value { font-size: 2rem; font-weight: 800; line-height: 1; display: block; min-width: 52px; }
.countdown-unit-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; margin-top: 4px; }
.countdown-separator { font-size: 1.8rem; font-weight: 300; opacity: 0.6; align-self: flex-start; margin-top: 2px; }

/* ===== PROGRESS ===== */
.progress-overview { padding: 16px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.progress-card { background: var(--white); border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); }
.progress-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.progress-card-title { font-size: 0.8rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; }
.progress-card-count { font-size: 0.75rem; font-weight: 700; color: var(--ocean-mid); }
.progress-bar-bg { height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; background: linear-gradient(90deg, var(--ocean-light), var(--ocean-mid)); }
.progress-card.purchased .progress-bar-fill { background: linear-gradient(90deg, #fdba74, #fb923c); }

/* ===== TABS ===== */
.tab-container { padding: 0 20px; margin-bottom: 8px; }
.tab-bar {
  display: flex; background: var(--white); border-radius: var(--radius-lg); padding: 4px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 1; min-width: fit-content; padding: 10px 14px; border: none; background: transparent;
  border-radius: var(--radius-md); font-size: 0.8rem; font-weight: 600; color: var(--gray-500);
  cursor: pointer; transition: var(--transition); white-space: nowrap;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tab-btn.active { background: var(--ocean-deep); color: var(--white); box-shadow: var(--shadow-md); }
.tab-btn:not(.active):hover { background: var(--gray-100); color: var(--gray-700); }

.tab-content { display: none; padding: 0 20px 20px; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== CHECKLIST ===== */
.section-header { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 12px; }
.section-header:first-child { margin-top: 0; }
.section-title { font-size: 1.1rem; font-weight: 700; color: var(--gray-800); display: flex; align-items: center; gap: 8px; }
.section-action { font-size: 0.75rem; color: var(--ocean-mid); font-weight: 600; cursor: pointer; border: none; background: none; padding: 4px 8px; border-radius: var(--radius-sm); transition: var(--transition); }
.section-action:hover { background: var(--ocean-pale); }

.checklist { display: flex; flex-direction: column; gap: 8px; }
.checklist-item {
  background: var(--white); border-radius: var(--radius-md); padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 12px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100); transition: var(--transition); cursor: pointer;
  position: relative; overflow: hidden;
}
.checklist-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ocean-light); transition: var(--transition); }
.checklist-item.checked::before { background: var(--palm); }
.checklist-item.checked { background: var(--gray-50); border-color: var(--gray-200); }
.checklist-item.checked .item-text { text-decoration: line-through; color: var(--gray-400); }
.checklist-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.check-box {
  width: 22px; height: 22px; min-width: 22px; border-radius: 6px; border: 2px solid var(--gray-300);
  display: flex; align-items: center; justify-content: center; transition: var(--transition); margin-top: 1px;
}
.checklist-item.checked .check-box { background: var(--palm); border-color: var(--palm); }
.check-box svg { width: 14px; height: 14px; stroke: white; stroke-width: 3; fill: none; opacity: 0; transition: var(--transition); }
.checklist-item.checked .check-box svg { opacity: 1; }
.item-content { flex: 1; min-width: 0; }
.item-text { font-size: 0.9rem; font-weight: 500; color: var(--gray-800); transition: var(--transition); }
.item-note { font-size: 0.75rem; color: var(--gray-400); margin-top: 2px; }
.item-qty { font-size: 0.7rem; font-weight: 700; color: var(--ocean-mid); background: var(--ocean-pale); padding: 2px 8px; border-radius: 10px; white-space: nowrap; margin-top: 4px; display: inline-block; }
.item-actions { display: flex; gap: 4px; opacity: 0; transition: var(--transition); }
.checklist-item:hover .item-actions { opacity: 1; }
.item-action-btn {
  width: 28px; height: 28px; border: none; background: var(--gray-100); border-radius: 6px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; transition: var(--transition);
}
.item-action-btn:hover { background: var(--gray-200); }
.item-action-btn.delete:hover { background: #fee2e2; color: var(--coral); }

/* ===== ITINERARY ===== */
.itinerary-card { background: var(--white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); border: 1px solid var(--gray-100); margin-bottom: 16px; }
.itinerary-header { background: linear-gradient(135deg, var(--ocean-deep), var(--ocean-mid)); color: white; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; }
.itinerary-header h3 { font-size: 0.95rem; font-weight: 700; }
.itinerary-type { font-size: 0.7rem; background: rgba(255,255,255,0.2); padding: 3px 10px; border-radius: 12px; font-weight: 600; }
.itinerary-body { padding: 20px; }
.flight-route { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.flight-point { text-align: center; }
.flight-code { font-size: 1.5rem; font-weight: 800; color: var(--ocean-deep); }
.flight-city { font-size: 0.75rem; color: var(--gray-500); margin-top: 2px; }
.flight-time { font-size: 1.1rem; font-weight: 700; color: var(--gray-800); margin-top: 6px; }
.flight-line { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 0 16px; position: relative; }
.flight-line::before { content: ''; width: 100%; height: 2px; background: var(--gray-200); position: absolute; top: 50%; }
.flight-line svg { position: relative; z-index: 1; background: var(--white); padding: 0 4px; }
.flight-duration { font-size: 0.7rem; color: var(--gray-400); margin-top: 4px; position: relative; z-index: 1; }
.flight-details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 16px; border-top: 1px solid var(--gray-100); }
.flight-detail { display: flex; flex-direction: column; }
.flight-detail-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-400); font-weight: 600; }
.flight-detail-value { font-size: 0.85rem; font-weight: 600; color: var(--gray-700); margin-top: 2px; }
.confirmation-code { background: var(--sand-light); border: 1px dashed var(--sand); border-radius: var(--radius-sm); padding: 12px 16px; text-align: center; margin-top: 16px; }
.confirmation-code-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-500); font-weight: 600; }
.confirmation-code-value { font-size: 1.2rem; font-weight: 800; color: var(--ocean-deep); letter-spacing: 0.1em; margin-top: 4px; }

/* ===== ACTIVITIES ===== */
.activity-card { background: var(--white); border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); margin-bottom: 10px; transition: var(--transition); }
.activity-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.activity-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.activity-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.activity-icon.beach { background: #fef3c7; }
.activity-icon.water { background: #dbeafe; }
.activity-icon.food { background: #fce7f3; }
.activity-icon.fun { background: #d1fae5; }
.activity-icon.relax { background: #ede9fe; }
.activity-title { font-size: 0.9rem; font-weight: 600; color: var(--gray-800); }
.activity-desc { font-size: 0.8rem; color: var(--gray-500); line-height: 1.5; }
.activity-tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.activity-tag { font-size: 0.65rem; font-weight: 600; padding: 3px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.activity-tag.kids { background: #fef3c7; color: #92400e; }
.activity-tag.all { background: #dbeafe; color: #1e40af; }
.activity-tag.relax { background: #ede9fe; color: #5b21b6; }

/* ===== NOTES ===== */
.note-card { background: var(--white); border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); }
.note-card textarea { width: 100%; border: none; resize: none; font-family: inherit; font-size: 0.85rem; color: var(--gray-700); line-height: 1.6; min-height: 80px; }
.note-card textarea:focus { outline: none; }
.note-card .note-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--gray-100); }
.note-card .note-time { font-size: 0.7rem; color: var(--gray-400); }
.note-card .note-delete { background: none; border: none; color: var(--gray-400); cursor: pointer; font-size: 0.8rem; padding: 4px 8px; border-radius: 4px; transition: var(--transition); }
.note-card .note-delete:hover { background: #fee2e2; color: var(--coral); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200;
  display: none; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.visible { display: flex; animation: fadeIn 0.3s ease; }
.modal-content {
  background: var(--white); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px 32px; width: 100%; max-width: 500px;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-content h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; color: var(--gray-800); }
.modal-content input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 0.9rem; font-family: inherit;
  transition: var(--transition); margin-bottom: 8px;
}
.modal-content input:focus { outline: none; border-color: var(--ocean-light); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15); }
.form-row { display: flex; gap: 8px; }
.form-row input { flex: 1; margin-bottom: 0; }

/* ===== BUTTONS ===== */
.btn {
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: var(--transition); display: inline-flex; align-items: center;
  justify-content: center; gap: 6px;
}
.btn-primary { background: var(--ocean-deep); color: var(--white); }
.btn-primary:hover { background: var(--ocean-mid); }
.btn-secondary { background: var(--gray-100); color: var(--gray-600); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--nav-height);
  background: var(--white); border-top: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 100; padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 12px; border: none; background: none; cursor: pointer;
  color: var(--gray-400); transition: var(--transition); border-radius: var(--radius-sm);
  min-width: 56px;
}
.nav-item.active { color: var(--ocean-deep); }
.nav-item:hover { color: var(--ocean-mid); }
.nav-icon { font-size: 1.3rem; line-height: 1; }
.nav-label { font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  .progress-overview { max-width: 600px; margin: 0 auto; }
  .tab-container { max-width: 600px; margin: 0 auto 8px; }
  .tab-content { max-width: 600px; margin: 0 auto; }
  .bottom-nav { max-width: 600px; left: 50%; transform: translateX(-50%); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}

@media (max-width: 360px) {
  .countdown-value { font-size: 1.5rem; min-width: 40px; }
  .flight-code { font-size: 1.2rem; }
  .tab-btn { padding: 8px 10px; font-size: 0.75rem; }
}

/* ===== UTILITIES ===== */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--gray-400);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state-text { font-size: 0.9rem; }
