@import './design-tokens.css';

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: radial-gradient(circle at 50% 0%, var(--primary-subtle) 0%, transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

input, select, textarea {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  width: 100%;
  transition: border-color var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  outline: none;
  background: var(--bg-input-focus);
}

/* Glassmorphism Containers & Cards */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  transition: all var(--transition-normal);
}

.glass-card:hover {
  border-color: var(--border-glass-hover);
  background: var(--bg-card-hover);
}

/* Header & Navbar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-glass);
  padding: 0.75rem 1.25rem;
}

.header-container {
  max-width: 1350px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.header-brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.brand-logo .logo-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-trip-select {
  max-width: 220px;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-nav-tabs);
  padding: 0.3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.nav-btn:hover {
  color: var(--text-main);
}

.nav-btn.active {
  color: #14171d;
  background: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.header-btn-new, .header-btn-auth {
  white-space: nowrap;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--bg-header);
  backdrop-filter: var(--backdrop-blur);
  border-top: 1px solid var(--border-glass);
  padding: 0.4rem 0.5rem;
  justify-content: space-around;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

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

@media (max-width: 768px) {
  .nav-tabs {
    display: none;
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .app-container {
    padding-bottom: 5.5rem !important;
  }
  .header-trip-select {
    max-width: 160px;
  }
}

/* Main Container */
.app-container {
  max-width: 1350px;
  margin: 1.5rem auto;
  padding: 0 1.25rem 3rem 1.25rem;
}

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--primary);
  color: #14171d;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--primary-subtle);
  border-color: var(--primary);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.btn-sm {
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  padding: 0.55rem;
  border-radius: var(--radius-md);
}

/* Trip Hero Banner */
.trip-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.75rem;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
  padding: 1.75rem;
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-md);
}

.trip-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.4) contrast(1.1);
}

.trip-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 23, 29, 0.95) 0%, rgba(20, 23, 29, 0.3) 70%, transparent 100%);
}

.trip-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.trip-hero-info h1 {
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.trip-meta-pills {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: var(--bg-meta-pill);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.meta-pill-budget {
  background: rgba(6, 78, 59, 0.85) !important;
  color: #6ee7b7 !important;
  border: 1px solid #059669 !important;
  font-weight: 700 !important;
}

.status-badge {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
}
.status-geplant { background: #451a03; color: #fde047; border: 1px solid #d97706; }
.status-aktiv { background: #064e3b; color: #6ee7b7; border: 1px solid #059669; }
.status-vergangen { background: #1e293b; color: #e2e8f0; border: 1px solid #475569; }

.hero-action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.hero-action-buttons .btn {
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  backdrop-filter: blur(8px);
  font-weight: 600;
}

.hero-action-buttons .btn:hover {
  background: rgba(45, 55, 72, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Layout Grid for Itinerary */
.itinerary-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .itinerary-grid {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Stops List */
.stops-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.stop-card {
  position: relative;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.stop-card:hover {
  border-color: var(--border-glass-hover);
}

.stop-card.active {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.stop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.stop-name {
  font-weight: 700;
  font-size: 1rem;
}

.hotel-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.hotel-badge.has-hotel {
  background: #064e3b;
  color: #6ee7b7;
  border: 1px solid #059669;
}

.hotel-badge.no-hotel {
  background: #451a03;
  color: #fde047;
  border: 1px solid #d97706;
}

.stop-dates {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Day-by-Day Activity Stream */
.day-stream {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.day-box {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 1rem;
}

.day-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.day-badge {
  min-width: 56px;
  height: 54px;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-md);
  background: var(--primary-subtle);
  border: 1px solid var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  color: var(--primary);
  font-weight: 800;
  text-align: center;
  flex-shrink: 0;
}

.day-badge span {
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.1;
}

.day-badge small {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-sand);
  opacity: 0.85;
  line-height: 1;
  margin-top: 3px;
  white-space: nowrap;
}

.day-title-info h4 {
  font-size: 1.05rem;
}

.day-title-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Activity Items */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bg-activity);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  gap: 0.85rem;
}

.activity-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.activity-item.done {
  opacity: 0.55;
}
.activity-item.done .activity-title {
  text-decoration: line-through;
}

.activity-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.activity-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
}

.activity-checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: #14171d;
}

.activity-time-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  white-space: nowrap;
}

.activity-cat-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-sm);
  color: #14171d;
}

.cat-sightseeing { background: var(--cat-sightseeing); }
.cat-gastronomie { background: var(--cat-gastronomie); }
.cat-kultur { background: var(--cat-kultur); }
.cat-transport { background: var(--cat-transport); }
.cat-entspannung { background: var(--cat-entspannung); }
.cat-abenteuer { background: var(--cat-abenteuer); }
.cat-sonstiges { background: var(--cat-sonstiges); }

.activity-details {
  display: flex;
  flex-direction: column;
}

.activity-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.activity-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.activity-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.activity-price {
  font-weight: 700;
  font-size: 0.88rem;
  color: #6ee7b7;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 12, 16, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: 580px;
  background: var(--bg-glass-modal);
  border: 1px solid var(--border-glass-hover);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-glass);
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 576px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Compact Agenda Calendar View */
.agenda-calendar-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.compact-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

@media (max-width: 600px) {
  .compact-calendar-grid {
    gap: 0.25rem;
  }
}

.agenda-day-cell {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.4rem;
  min-height: 75px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.agenda-day-cell:hover {
  border-color: var(--border-glass-hover);
}

.agenda-day-cell.selected {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.agenda-day-num {
  font-weight: 700;
  font-size: 0.85rem;
}

.agenda-day-dots {
  display: flex;
  gap: 3px;
  margin-top: 0.3rem;
}

.dot-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.expanded-day-agenda {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1rem;
}

/* Route Timeline View */
.route-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  padding-left: 2rem;
}

.route-timeline::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 1rem;
  bottom: 1rem;
  width: 2px;
  background: var(--primary);
}

.timeline-node {
  position: relative;
}

.node-dot {
  position: absolute;
  left: -2.15rem;
  top: 0.85rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 3px solid var(--primary);
}

/* Statistics Dashboard Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: var(--primary-subtle);
  color: var(--primary);
}

.stat-info h5 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-info .stat-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Progress Bars */
.progress-bar-bg {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Packing List Items */
.packing-category {
  margin-bottom: 1.5rem;
}

.packing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.65rem;
}

.packing-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.8rem;
  background: rgba(20, 23, 29, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

/* Print View Styles */
@media print {
  body { background: #fff !important; color: #000 !important; }
  .app-header, .mobile-bottom-nav, .btn { display: none !important; }
}

/* ==========================================================================
   Motion Design & Animations (Juice-Up)
   ========================================================================== */

/* Keyframes */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Page View Transitions */
.view-container {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.view-enter {
  opacity: 0;
  transform: translateY(8px);
}

.view-enter-active {
  opacity: 1;
  transform: translateY(0);
}

.view-exit {
  opacity: 0;
  transform: translateY(-8px);
}

/* Staggered List Animations */
.animate-slide-up > * {
  animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0; /* Initial state before animation */
}

/* Stagger delays for up to 10 children */
.animate-slide-up > *:nth-child(1) { animation-delay: 0.05s; }
.animate-slide-up > *:nth-child(2) { animation-delay: 0.10s; }
.animate-slide-up > *:nth-child(3) { animation-delay: 0.15s; }
.animate-slide-up > *:nth-child(4) { animation-delay: 0.20s; }
.animate-slide-up > *:nth-child(5) { animation-delay: 0.25s; }
.animate-slide-up > *:nth-child(6) { animation-delay: 0.30s; }
.animate-slide-up > *:nth-child(7) { animation-delay: 0.35s; }
.animate-slide-up > *:nth-child(8) { animation-delay: 0.40s; }
.animate-slide-up > *:nth-child(9) { animation-delay: 0.45s; }
.animate-slide-up > *:nth-child(10) { animation-delay: 0.50s; }
.animate-slide-up > *:nth-child(n+11) { animation-delay: 0.55s; }

/* Micro-Interactions: Cards & Panels */
.glass-card, .stop-card, .stat-card, .glass-panel {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.2s ease, background 0.2s ease;
}

.glass-card:hover, .stop-card:hover, .stat-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-lg);
}

/* Active stop card shouldn't jump around if we click it, but still looks lifted */
.stop-card.active {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
  z-index: 2;
}

/* Micro-Interactions: Buttons */
.btn {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:active {
  transform: scale(0.96);
}
.btn-icon:active {
  transform: scale(0.92);
}

/* Smooth Checkbox Interaction */
.activity-checkbox {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.activity-checkbox:active {
  transform: scale(0.85);
}
.activity-checkbox.checked {
  animation: pulseCheck 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pulseCheck {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

