/* 
  Nous Research "Hermes" Aesthetic - Mobile First Stylesheet
*/

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&display=swap');

:root {
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', Courier, monospace;
  
  /* Color Palette: Nous Dark theme */
  --bg-base: #07090e;         /* Deep obsidian black */
  --bg-sidebar: #0b0e14;      /* Slate-black sidebar */
  --bg-surface: #0f131a;      /* Medium slate-black panels */
  --bg-surface-hover: #161c26;
  
  --border-color: #1e2530;    /* Muted slate border */
  --border-glow: #c89a5a;     /* Hermes Gold accent */
  
  --color-primary: #c89a5a;   /* Gold/Bronze */
  --color-primary-glow: rgba(200, 154, 90, 0.2);
  --color-primary-dark: #a27b43;
  
  --color-secondary: #4a5d78; /* Muted tech blue */
  --color-success: #3fb950;   /* GitHub green */
  --color-success-glow: rgba(63, 185, 80, 0.15);
  --color-danger: #f43f5e;    /* Crimson Red */
  --color-warning: #d29922;   /* Warn yellow */
  
  --text-main: #f3ecdd;       /* Cornsilk (warm off-white) */
  --text-muted: #768390;      /* Muted gray */
  --text-inverse: #07090e;    /* Contrast dark */
  
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 15px var(--color-primary-glow);
  
  --radius-sm: 3px;
  --radius-md: 6px;
  
  --transition-fast: 0.15s ease-in-out;
}

/* Global Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-mono);
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  line-height: 1.5;
  font-size: 13.5px;
}

/* Ambient Subtle Background Orbs (Low Opacity) */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.12;
}
.orb-1 {
  width: 80vw;
  height: 80vw;
  background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
  top: -20%;
  right: -20%;
}
.orb-2 {
  width: 80vw;
  height: 80vw;
  background: radial-gradient(circle, var(--color-secondary) 0%, transparent 70%);
  bottom: -20%;
  left: -20%;
}

/* Main Container (Centered frame on desktop, full-width on mobile) */
.app-container {
  width: 100%;
  max-width: 680px; /* Highly optimized mobile frame width on desktop */
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 76px 12px; /* Bottom padding accounts for bottom navigation */
}

/* Header Styling */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  position: relative;
  margin-bottom: 12px;
}

.app-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
}

.brand {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.brand-icon {
  width: 18px;
  height: 18px;
  color: var(--color-primary);
  margin-right: 6px;
  vertical-align: middle;
}

.brand h1 {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-block;
  vertical-align: middle;
}

.brand h1 span {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 6px;
  letter-spacing: 0.5px;
}

/* Sync Status Widget */
.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.01);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background-color var(--transition-fast);
}

.status-dot.synced {
  background: var(--color-success);
  box-shadow: 0 0 6px var(--color-success);
}

.status-dot.syncing {
  background: var(--color-warning);
  box-shadow: 0 0 6px var(--color-warning);
  animation: pulse-sync 1s infinite alternate;
}

.status-dot.error {
  background: var(--color-danger);
  box-shadow: 0 0 6px var(--color-danger);
}

@keyframes pulse-sync {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* Main View Panels Layout */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* View Panels logic */
.view-panel {
  display: none;
  width: 100%;
}

.view-panel.active {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: view-slide 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes view-slide {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* View Section Title */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.view-header h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-header h2 i {
  width: 14px;
  height: 14px;
  color: var(--color-primary);
}

/* Horizontal Days Scroller */
.days-scroll-container {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.days-scroll-container::-webkit-scrollbar {
  display: none; /* Hide scrollbars on mobile */
}

.days-list-horizontal {
  display: flex;
  gap: 6px;
  list-style: none;
  padding: 0;
  width: max-content;
}

.day-item-tab {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 8px 14px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-width: 80px;
  transition: all var(--transition-fast);
}

.day-item-tab:hover {
  border-color: rgba(200, 154, 90, 0.4);
}

.day-item-tab.active {
  border-color: var(--color-primary);
  background: rgba(200, 154, 90, 0.08);
}

.day-item-tab .day-tab-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}
.day-item-tab.active .day-tab-name {
  color: var(--color-primary);
}

.day-item-tab .day-tab-date {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 2px;
}

.day-item-tab.day-add-btn {
  border-style: dashed;
  border-color: var(--border-color);
  color: var(--text-muted);
  min-width: 48px;
}
.day-item-tab.day-add-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Timeline Day Header */
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.timeline-header h2 {
  font-size: 14px;
  font-weight: 700;
}

/* Timeline Paths & Events */
.timeline-path {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-events {
  position: relative;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-events::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  border-left: 1px dashed var(--border-color);
}

/* Event Card Item - Compact mobile style */
.event-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Event Connector Node */
.event-node {
  position: absolute;
  left: -16px;
  top: 19px;
  width: 5px;
  height: 5px;
  background: var(--bg-base);
  border: 1px solid var(--color-primary);
  z-index: 2;
  transform: translateX(-50%);
}

.event-card:hover .event-node {
  background: var(--color-primary);
}

.event-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.event-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Brackets category labels */
.category-badge {
  font-size: 9.5px;
  font-weight: 500;
  text-transform: uppercase;
  padding: 1px 5px;
  border: 1px solid var(--border-color);
  border-radius: 2px;
}

.category-badge[data-cat="sightseeing"] { border-color: rgba(200, 154, 90, 0.3); color: var(--color-primary); }
.category-badge[data-cat="food"] { border-color: rgba(210, 153, 34, 0.3); color: var(--color-warning); }
.category-badge[data-cat="hotel"] { border-color: rgba(63, 185, 80, 0.3); color: var(--color-success); }
.category-badge[data-cat="transit"] { border-color: rgba(74, 93, 120, 0.3); color: #8892b0; }
.category-badge[data-cat="shopping"] { border-color: rgba(244, 63, 94, 0.3); color: var(--color-danger); }

.time-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
  padding: 1px 5px;
  border: 1px solid var(--border-color);
}

.event-title {
  font-size: 14px;
  font-weight: 600;
}

.event-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--color-primary);
  text-decoration: none;
  width: fit-content;
}

.event-location:hover {
  text-decoration: underline;
}

.event-location i {
  width: 12px;
  height: 12px;
}

.event-description {
  font-size: 12px;
  color: var(--text-muted);
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 10px;
  border-left: 2px solid var(--color-primary);
}

.event-actions {
  display: flex;
  gap: 4px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-icon {
  width: 38px;
  height: 38px;
  color: rgba(255, 255, 255, 0.08);
}

.empty-state h3 {
  font-size: 13px;
  text-transform: uppercase;
}

.empty-state p {
  font-size: 11.5px;
  color: var(--text-muted);
}

.animate-spin-slow {
  animation: spin 16s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Floating Action Button (FAB) */
.fab {
  position: fixed;
  bottom: 76px; /* Just above bottom nav bar */
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--text-inverse);
  border: none;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--color-primary-glow);
  cursor: pointer;
  z-index: 99;
  transition: all 0.2s ease;
}

.fab:hover:not(:disabled),
.fab:active:not(:disabled) {
  transform: scale(1.05);
  background: var(--color-primary-dark);
  box-shadow: 0 6px 20px var(--color-primary-glow);
}

.fab i {
  width: 22px;
  height: 22px;
}

.fab:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Packing Checklist styling */
.packing-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.packing-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.packing-item-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
}

.packing-item-checkbox input {
  appearance: none;
  width: 15px;
  height: 15px;
  border: 1px solid var(--border-color);
  background: var(--bg-base);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.packing-item-checkbox input:checked {
  background: var(--color-success);
  border-color: var(--color-success);
}

.packing-item-checkbox input:checked::after {
  content: '✓';
  color: var(--text-inverse);
  font-size: 11px;
  font-weight: bold;
}

.packing-item-checkbox.checked span {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Tools/Settings views */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.settings-card h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-card h3 i {
  width: 14px;
  height: 14px;
  color: var(--color-primary);
}

.margin-top-12 {
  margin-top: 12px;
}

.action-row {
  display: flex;
  gap: 8px;
}

.action-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Bottom Sticky Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 680px; /* Matches app container max-width */
  height: 56px;
  background: rgba(11, 14, 20, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

.nav-tab {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  flex: 1;
  height: 100%;
  transition: all var(--transition-fast);
}

.nav-tab i {
  width: 18px;
  height: 18px;
}

.nav-tab span {
  font-size: 9.5px;
  font-family: var(--font-mono);
  font-weight: 500;
}

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

.nav-tab.active {
  color: var(--color-primary);
  text-shadow: 0 0 4px var(--color-primary-glow);
}

/* Custom Buttons & Dialog Forms overrides */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  background: transparent;
  color: var(--text-main);
  text-transform: uppercase;
  transition: all var(--transition-fast);
  min-height: 38px; /* Touch friendly height */
}

.btn-primary {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-primary:hover, .btn-primary:active {
  background: var(--color-primary);
  color: var(--text-inverse);
}

.btn-ghost {
  border-color: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover, .btn-ghost:active {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.btn-secondary {
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover, .btn-secondary:active {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.btn-danger-outline {
  border-color: rgba(244, 63, 94, 0.4);
  color: var(--color-danger);
}
.btn-danger-outline:hover, .btn-danger-outline:active {
  background: rgba(244, 63, 94, 0.1);
  border-color: var(--color-danger);
}

.btn-icon-small {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon-small:hover, .btn-icon-small:active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(200, 154, 90, 0.05);
}

.btn-icon-small svg {
  width: 14px;
  height: 14px;
}


/* Dialog Modals overrides */
.glass-dialog {
  margin: auto;
  border: 1px solid var(--color-primary);
  background: var(--bg-sidebar);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0;
  max-width: 460px;
  width: calc(100% - 24px);
  box-shadow: var(--shadow-md);
  outline: none;
  font-family: var(--font-mono);
}

.glass-dialog::backdrop {
  background: rgba(5, 7, 9, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(200, 154, 90, 0.03);
}

.dialog-header h3 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--color-primary);
}

.dialog-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.1);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-row {
  display: flex;
  gap: 10px;
}

label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
}

input[type="text"],
input[type="date"],
input[type="time"],
select,
textarea {
  background: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  transition: all var(--transition-fast);
  width: 100%;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* Custom Select wrapper override */
.select-wrapper {
  width: 100%;
}

.select-wrapper select {
  padding-right: 32px;
}

.select-arrow {
  right: 12px;
}

/* Desktop Styles Adaptations */
@media (min-width: 768px) {
  /* Expand max width on desktops for a beautiful tablet cockpit look */
  .app-container {
    max-width: 800px;
    padding-bottom: 24px; /* No need for huge bottom padding on desktop */
  }

  .bottom-nav {
    position: static;
    transform: none;
    max-width: none;
    margin-top: 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-sidebar);
  }

  .fab {
    position: absolute;
    bottom: auto;
    top: 68px;
    right: 16px;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    box-shadow: none;
    border: 1px solid var(--color-primary);
    background: transparent;
    color: var(--color-primary);
  }

  .fab:hover:not(:disabled) {
    background: var(--color-primary);
    color: var(--text-inverse);
    transform: none;
  }

  .fab i {
    width: 16px;
    height: 16px;
  }

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

/* Scrollbars styling */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
