/* styles.css */
/* PickPinPack Design System - Theme: Pebble & Pastel */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Quicksand:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette - Pastel & Warm */
  --primary: #ff7a59;
  --primary-hover: #e56342;
  --primary-light: #fff0eb;
  
  --secondary: #65b891;
  --secondary-hover: #509e79;
  --secondary-light: #ecf7f2;
  
  --accent: #4ea8de;
  --accent-hover: #3b90c7;
  --accent-light: #e8f4fb;

  --warning: #ffb703;
  --warning-light: #fff8e6;
  --danger: #f25c54;
  --danger-light: #fdf0ef;

  /* Neutrals */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-dark: #2d3748;
  --text-muted: #718096;
  --border-color: #edf2f7;
  
  /* Styling Tokens */
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Quicksand', sans-serif;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 16px 35px rgba(255, 122, 89, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --text-dark: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --primary-light: #3a221d;
  --secondary-light: #162c21;
  --accent-light: #12263a;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 600;
}

button, input, select, textarea {
  font-family: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Layout Core */
#app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 80px; /* Space for mobile nav */
}

/* Navigation Bar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-title);
  color: var(--primary);
}

.nav-logo img {
  height: 36px;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.nav-btn:hover {
  background-color: var(--border-color);
  color: var(--text-dark);
  transform: translateY(-2px);
}

.nav-btn.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Trip Header Section */
.trip-header-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 20px 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  transition: var(--transition);
}

.trip-info-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trip-title-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trip-title {
  font-size: 28px;
  color: var(--text-dark);
}

.trip-dates {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.trip-meta-stats {
  display: flex;
  gap: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-title);
  color: var(--text-dark);
}

.stat-value.highlight {
  color: var(--primary);
}

/* Status Indicator Cloud Sync */
.sync-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  background-color: var(--border-color);
  color: var(--text-muted);
}

.sync-status-badge.syncing {
  background-color: var(--secondary-light);
  color: var(--secondary);
}

.sync-status-badge.local {
  background-color: var(--warning-light);
  color: var(--warning);
}

.sync-status-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

.sync-status-badge.syncing .dot {
  animation: pulse 1.5s infinite ease-in-out;
}

/* Main Display Panels */
.panel-container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  padding: 0 24px 24px 24px;
  flex-grow: 1;
}

.panel-full {
  grid-template-columns: 1fr;
}

.left-panel, .right-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Base Card Styles */
.app-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: var(--transition);
}

.app-card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 20px;
  margin-bottom: 20px;
  color: var(--text-dark);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
}

/* Custom Pin Setup view */
.setup-view-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  padding: 40px 20px;
}

.setup-card {
  max-width: 500px;
  width: 100%;
  text-align: center;
}

.setup-icon-bubble {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px auto;
  font-size: 36px;
  box-shadow: 0 10px 20px rgba(255, 122, 89, 0.1);
}

.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background-color: var(--bg-main);
  color: var(--text-dark);
  font-size: 15px;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Custom Checkbox Split styles */
.split-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.split-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-main);
  transition: var(--transition);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-bounce);
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: var(--shadow-hover);
}

.btn-secondary {
  background-color: var(--secondary-light);
  color: var(--secondary);
}

.btn-secondary:hover {
  background-color: var(--secondary);
  color: white;
}

.btn-outline {
  border: 2px solid var(--border-color);
  background-color: transparent;
  color: var(--text-dark);
}

.btn-outline:hover {
  background-color: var(--border-color);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
}

.btn-icon:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-light);
}

/* Day Tabs in Itinerary */
.day-selector-container {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
  scrollbar-width: none; /* Firefox */
}

.day-selector-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.day-tab {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background-color: var(--bg-card);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.day-tab:hover {
  border-color: var(--primary-light);
  background-color: var(--primary-light);
}

.day-tab.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}

.day-tab.add-day-btn {
  border-style: dashed;
  color: var(--text-muted);
}

.day-tab.add-day-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Activity List */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100px;
}

.activity-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  position: relative;
  transition: var(--transition-bounce);
  animation: slideIn 0.3s ease;
}

.activity-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

/* Colors by Category */
.activity-card.travel { border-left: 6px solid var(--accent); }
.activity-card.food { border-left: 6px solid var(--warning); }
.activity-card.attraction { border-left: 6px solid var(--primary); }
.activity-card.lodging { border-left: 6px solid var(--secondary); }
.activity-card.other { border-left: 6px solid var(--text-muted); }

.activity-cat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.travel .activity-cat-icon { background-color: var(--accent-light); color: var(--accent); }
.food .activity-cat-icon { background-color: var(--warning-light); color: var(--warning); }
.attraction .activity-cat-icon { background-color: var(--primary-light); color: var(--primary); }
.lodging .activity-cat-icon { background-color: var(--secondary-light); color: var(--secondary); }
.other .activity-cat-icon { background-color: var(--border-color); color: var(--text-muted); }

.activity-details {
  flex-grow: 1;
}

.activity-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.activity-title {
  font-weight: 700;
  font-size: 16px;
}

.activity-sub-type {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: capitalize;
  display: inline-block;
  background-color: var(--border-color);
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 2px;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.activity-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.activity-meta-item a:hover {
  text-decoration: underline;
  color: var(--primary);
}

.activity-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

/* Map CSS */
.map-wrapper {
  height: 380px;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
}

#map {
  height: 100%;
  width: 100%;
}

.map-control-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  background: white;
  padding: 8px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* Map markers cute design override */
.cute-map-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  background: var(--primary);
  transform: rotate(-45deg);
  border: 2px solid white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.cute-map-pin .inner {
  transform: rotate(45deg);
  font-size: 12px;
  font-weight: 700;
  color: white;
}

.cute-map-pin.travel { background-color: var(--accent); }
.cute-map-pin.food { background-color: var(--warning); }
.cute-map-pin.attraction { background-color: var(--primary); }
.cute-map-pin.lodging { background-color: var(--secondary); }
.cute-map-pin.other { background-color: var(--text-muted); }

/* Expense Dashboard Components */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.gauge-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Custom animated circular progress or bar */
.bar-progress-container {
  width: 100%;
  height: 20px;
  border-radius: 50px;
  background-color: var(--border-color);
  overflow: hidden;
  margin-top: 15px;
}

.bar-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 50px;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  transition: width 1.5s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.bar-progress-fill.over-budget {
  background: linear-gradient(90deg, var(--warning), var(--danger));
}

/* SVG Donut Chart */
.chart-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.donut-svg {
  width: 160px;
  height: 160px;
  transform: rotate(-90deg);
}

.donut-segment {
  fill: none;
  stroke-width: 12;
  transition: var(--transition);
  cursor: pointer;
}

.donut-segment:hover {
  stroke-width: 16;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* Debt Settling list */
.settlement-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background-color: var(--secondary-light);
  border: 1px solid rgba(101, 184, 145, 0.2);
  transition: var(--transition);
  animation: scaleIn 0.3s ease;
}

.settle-card.danger {
  background-color: var(--danger-light);
  border-color: rgba(242, 92, 84, 0.2);
}

.settle-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settle-arrow {
  color: var(--secondary);
}

.settle-card.danger .settle-arrow {
  color: var(--danger);
}

.settle-name {
  font-weight: 700;
  font-size: 15px;
}

.settle-amount {
  font-weight: 800;
  font-size: 18px;
  font-family: var(--font-title);
  color: var(--text-dark);
}

/* Expenses table / list */
.expense-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  margin-bottom: 12px;
  transition: var(--transition-bounce);
}

.expense-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Modal Window styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.modal-content {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Auto-complete geocoding dropdown */
.autocomplete-container {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.autocomplete-item:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

/* Animations */
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.6; }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* Mobile Bottom Navigation (Mobile Tab bar) */
.mobile-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
  border: none;
  background: none;
  cursor: pointer;
  width: 25%;
  height: 100%;
  transition: var(--transition-bounce);
}

.mobile-nav-item.active {
  color: var(--primary);
}

.mobile-nav-item svg {
  width: 20px;
  height: 20px;
}

/* =========================================
   Toast Notification System
   ========================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background-color: var(--bg-card);
  color: var(--text-dark);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 14px;
  pointer-events: auto;
  animation: toastPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  max-width: 90vw;
}

.toast.success { border-left: 5px solid var(--secondary); }
.toast.error { border-left: 5px solid var(--danger); }
.toast.info { border-left: 5px solid var(--accent); }

.toast.hiding {
  animation: toastFade 0.3s ease forwards;
}

.toast-icon {
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast.success .toast-icon { color: var(--secondary); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--accent); }

@keyframes toastPop {
  0% { opacity: 0; transform: translateY(30px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastFade {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(20px) scale(0.9); }
}

/* =========================================
   Tab Transition Animation
   ========================================= */
.tab-content {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Media Queries for Responsive Design */
@media (max-width: 992px) {
  .panel-container {
    grid-template-columns: 1fr;
  }
  .right-panel {
    order: -1; /* Place map/dashboard on top on smaller screens */
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 70px; /* Space for mobile nav */
  }
  
  .navbar {
    padding: 12px 16px;
  }
  
  .nav-links {
    display: none; /* Hide top bar navigation, use bottom bar */
  }
  
  .mobile-nav-bar {
    display: flex;
  }
  
  .trip-header-card {
    margin: 12px 16px;
    padding: 16px;
  }
  
  .panel-container {
    padding: 0 16px 16px 16px;
  }
  
  .trip-title {
    font-size: 22px;
  }
  
  .trip-meta-stats {
    width: 100%;
    justify-content: space-between;
  }
  
  .activity-card {
    padding: 12px;
  }
  
  .modal-content {
    margin-bottom: 80px; /* Make sure it doesn't get covered by mobile navigation */
  }
}
