@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800&display=swap');

:root {
  --primary: #0f4c75;
  --secondary: #3282b8;
  --accent: #00d2ff;
  --bg: #f4f8fb;
  --card: #ffffff;
  --text: #1a2b3c;
  --text-light: #627d98;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --font: 'Outfit', sans-serif;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 76, 117, 0.1);
  --shadow-lg: 0 20px 40px -10px rgba(15, 76, 117, 0.15);
}

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

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 80px;
}

/* --- HERO HEADER --- */
.hero {
  height: 35vh;
  min-height: 280px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  background-size: cover;
  background-position: center;
  border-radius: 0 0 40px 40px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: -40px;
  z-index: 1;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15,76,117,0.4), rgba(15,76,117,0.8));
  z-index: -1;
}
.hero-content {
  padding: 20px;
  animation: slideUp 0.8s ease-out;
}
.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.3);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  text-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  opacity: 0.9;
  font-weight: 300;
}

/* --- NAVIGATION --- */
.nav-container {
  position: sticky;
  top: 20px;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0 20px;
}
.nav-bar {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  padding: 10px 14px;
  border-radius: 50px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255,255,255,0.5);
  overflow-x: auto;
  max-width: 100%;
}
.nav-bar a {
  text-decoration: none;
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 30px;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.nav-bar a:hover { background: #e2e8f0; color: var(--primary); }
.nav-bar a.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(15, 76, 117, 0.3);
}

/* --- MAIN LAYOUT --- */
.container {
  max-width: 900px;
  margin: 60px auto 0;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
  background: white;
  padding: 24px 30px;
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  border-left: 6px solid var(--accent);
}
.page-title h2 {
  font-size: 1.8rem;
  color: var(--primary);
  font-weight: 800;
  margin-bottom: 4px;
}
.page-title p { color: var(--text-light); font-size: 0.95rem; }
.budget-pill {
  background: #ecfdf5;
  color: var(--success);
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

/* --- TIMELINE CARDS --- */
.timeline {
  position: relative;
  padding-left: 30px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 20px;
  bottom: 20px;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent), var(--primary));
  border-radius: 3px;
  opacity: 0.5;
}
.stop-card {
  background: var(--card);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #e2e8f0;
}
.stop-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stop-dot {
  position: absolute;
  left: -30px;
  top: 30px;
  width: 21px;
  height: 21px;
  background: white;
  border: 4px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg);
}
.stop-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.stop-time {
  font-weight: 700;
  color: var(--secondary);
  font-size: 0.9rem;
  background: #e0f2fe;
  padding: 4px 12px;
  border-radius: 12px;
}
.stop-cost {
  font-weight: 800;
  color: var(--primary);
  font-size: 1rem;
}
.stop-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.stop-desc {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 14px;
}
.commute-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  color: var(--text);
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600;
}
.tags-container { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tag.food { background: #fee2e2; color: #b91c1c; }
.tag.activity { background: #dcfce7; color: #15803d; }
.tag.transport { background: #f3e8ff; color: #7e22ce; }
.tag.default { background: #f1f5f9; color: #475569; }

/* --- EDITING STYLES --- */
body.editing .stop-card {
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
}
body.editing [contenteditable="true"] {
  outline: none;
  border-bottom: 2px dashed var(--accent);
  transition: all 0.2s;
  cursor: text;
}
body.editing [contenteditable="true"]:hover {
  background: white;
  border-bottom: 2px solid var(--primary);
}
body.editing [contenteditable="true"]:focus {
  background: white;
  border-bottom: 2px solid var(--primary);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.stop-tools { display: none; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #e2e8f0; }
body.editing .stop-tools { display: flex; flex-wrap: wrap; }
.tool-btn {
  background: white; border: 1px solid #cbd5e1; color: var(--text-light);
  padding: 6px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.tool-btn:hover { background: #f1f5f9; color: var(--text); }
.tool-btn.del:hover { background: #fef2f2; color: var(--danger); border-color: #fca5a5; }

/* --- ACTION BAR --- */
.action-bar {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 30px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: none;
  padding: 12px 24px; border-radius: 30px; font-weight: 700; font-size: 0.95rem;
  cursor: pointer; transition: all 0.3s ease; font-family: var(--font);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-outline { background: white; color: var(--text); border: 2px solid #e2e8f0; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* --- GLOBAL SUMMARY WIDGET --- */
.global-summary {
  margin-top: 50px; padding: 30px; background: white; border-radius: 24px;
  box-shadow: var(--shadow-md); text-align: center;
  border-top: 6px solid var(--primary);
}
.global-summary h3 { color: var(--text-light); font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; }
.global-summary .total-amount { font-size: 2.5rem; font-weight: 800; color: var(--primary); margin: 10px 0; }
.global-summary p { font-size: 0.9rem; color: var(--text-light); }

/* --- SAVE TOAST --- */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--success); color: white; padding: 12px 24px; border-radius: 30px;
  font-weight: 700; box-shadow: var(--shadow-lg); opacity: 0; transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); z-index: 1000;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* --- ANIMATIONS --- */
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* --- PRINT --- */
@media print {
  .nav-container, .action-bar, .stop-tools, .toast, .global-summary { display: none !important; }
  body { background: white; padding-bottom: 0; }
  .hero { height: 150px; border-radius: 0; margin-bottom: 20px; box-shadow: none; }
  .hero::before { background: var(--primary); }
  .container { margin-top: 20px; }
  .stop-card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}
