:root {
  --bg-dark: #1a1c23;
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --color-travel: #e5484d;
  --color-hotel: #3b82f6;
  --color-event: #4ade80;
  --color-reminder: #f59e0b;
  --timeline-spine: #334155;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Landing / Generate pages */
.landing-page, .generate-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.landing-container, .generate-container {
  text-align: center;
  padding: 40px 20px;
  max-width: 480px;
  width: 100%;
}

.app-title { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.app-tagline { color: var(--text-muted); margin-bottom: 32px; font-size: 16px; }
.privacy-note { color: var(--text-muted); font-size: 12px; margin-top: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: #fff; color: #000; }
.btn-secondary { background: rgba(255,255,255,0.1); color: #fff; }

.form-group { text-align: left; margin-bottom: 24px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: 14px; }
.form-group select {
  width: 100%; padding: 12px; border-radius: 8px;
  background: #2a2d37; color: #fff; border: 1px solid rgba(255,255,255,0.1);
  font-size: 16px;
}

/* Timeline */
header { padding: 40px 20px 10px 20px; background: var(--bg-dark); }
header h2 { font-size: 14px; color: var(--text-muted); margin: 0; font-weight: 500; }
header h1 { font-size: 28px; margin: 5px 0; font-weight: 700; }

.legend { padding: 0 20px 20px; display: flex; gap: 15px; font-size: 11px; text-transform: uppercase; color: var(--text-muted); flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }

.timeline-container { position: relative; width: 100%; }
.timeline-wrapper::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 4px;
  background: var(--timeline-spine); transform: translateX(-50%); z-index: 1;
}

.time-axis { position: absolute; width: 100%; z-index: 5; pointer-events: none; }
.time-marker {
  position: absolute; left: 50%; transform: translate(-50%, -50%);
  width: 8px; height: 8px; background: var(--bg-dark); border: 2px solid var(--timeline-spine); border-radius: 50%;
}
.time-marker.day { width: 12px; height: 12px; background: #fff; border: 2px solid var(--timeline-spine); }

.time-label {
  position: absolute; left: calc(50% - 75px); width: 60px; text-align: right;
  font-size: 9px; color: var(--text-muted); font-weight: 600;
}
.day-label { position: absolute; left: 20px; font-size: 12px; font-weight: 700; color: var(--text-main); }

.events-area { position: relative; width: 100%; z-index: 3; }
.card {
  position: absolute; border-radius: 8px; padding: 8px; box-sizing: border-box; width: 42%;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden; pointer-events: auto;
}
.card:nth-child(even) { left: 5%; }
.card:nth-child(odd) { right: 5%; }

.type-travel { background: var(--color-travel); }
.type-hotel { background: var(--color-hotel); z-index: -1; }
.type-event { background: var(--color-event); color: #000; }
.type-reminder { background: var(--color-reminder); color: #000; }

.card-time { font-size: 9px; font-weight: 800; text-transform: uppercase; opacity: 0.9; margin-bottom: 2px; }
.card-title { font-size: 12px; font-weight: 700; line-height: 1.1; margin-bottom: 4px; }
.card-links { display: flex; flex-wrap: wrap; gap: 4px; }
.card-link { background: rgba(255,255,255,0.2); color: inherit; text-decoration: none; font-size: 9px; padding: 4px 8px; border-radius: 10px; }

/* Action strip */
.action-strip {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(26,28,35,0.95); backdrop-filter: blur(10px);
  padding: 12px 20px; display: flex; gap: 10px; justify-content: center;
  border-top: 1px solid rgba(255,255,255,0.1); z-index: 100;
}
.action-btn {
  padding: 10px 20px; border-radius: 10px; font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; flex: 1; max-width: 140px;
}
.action-btn-add { background: #fff; color: #000; }
.action-btn-share { background: rgba(255,255,255,0.15); color: #fff; }
.action-btn-install { background: rgba(255,255,255,0.15); color: #fff; }

/* Modal */
#modalOverlay, #reminderOverlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85);
  z-index: 1000; display: none; align-items: center; justify-content: center; backdrop-filter: blur(5px);
}
#modalContent, #reminderContent {
  background: #2a2d37; width: 85%; max-width: 400px; border-radius: 20px; padding: 25px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1);
}
.modal-input {
  width: 100%; box-sizing: border-box; margin-bottom: 12px; padding: 12px 15px;
  background: rgba(255,255,255,0.05); color: #fff; font-size: 16px; font-family: inherit;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; color-scheme: dark;
}
.modal-input::placeholder { color: var(--text-muted); }
.close-modal.close-modal-secondary { margin-top: 10px; background: rgba(255,255,255,0.15); color: #fff; }
.modal-header { font-size: 10px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.modal-links { display: flex; flex-direction: column; gap: 12px; }
.modal-link {
  background: rgba(255,255,255,0.05); color: #fff; text-decoration: none;
  padding: 12px 15px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); font-weight: 600;
}
.close-modal { margin-top: 25px; width: 100%; padding: 12px; border: none; border-radius: 12px; background: #fff; color: #000; font-weight: 700; cursor: pointer; }

/* Unrecognised email review panel */
.review-panel {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  margin: 12px 16px;
  padding: 14px 16px;
}
.review-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-reminder);
  margin-bottom: 10px;
}
.review-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
  gap: 10px;
}
.review-item:last-child { border-bottom: none; }
.review-item a { color: var(--color-reminder); text-decoration: none; flex: 1; }
.review-dismiss {
  background: rgba(255,255,255,0.1);
  color: var(--text-muted);
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Toast */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 10px 20px; border-radius: 20px; font-size: 14px;
  z-index: 200; opacity: 0; transition: opacity 0.3s;
}
.toast.show { opacity: 1; }

@media (min-width: 769px) { .link-mobile  { display: none; } }
@media (max-width: 768px) { .link-desktop { display: none; } }
