/* === CSS Custom Properties === */
:root {
  --bg-primary: #090e1a;
  --bg-card: #111827;
  --bg-tip: rgba(45, 212, 191, 0.12);
  --bg-warning: rgba(239, 68, 68, 0.10);
  --bg-checked: #0c1220;

  --accent-teal: #2dd4bf;
  --accent-blue: #38bdf8;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --accent-violet: #a78bfa;
  --accent-gray: #64748b;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border-driving: var(--accent-teal);
  --border-activity: var(--accent-blue);
  --border-accommodation: var(--accent-violet);
  --border-logistics: var(--accent-gray);

  --radius-sm: 8px;
  --radius-md: 12px;

  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  -webkit-font-smoothing: antialiased;
}

body.drawer-open {
  overflow: hidden;
}

/* === App Header === */
.app-header {
  background: linear-gradient(135deg, #0f1a2e 0%, #090e1a 100%);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header__title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  flex: 1;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-header__icon {
  width: 28px;
  height: 28px;
  margin-right: 8px;
}

/* === Theme Toggle === */
.theme-toggle {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: transform 0.3s ease;
}

.theme-toggle:active .theme-toggle__icon {
  transform: rotate(30deg) scale(0.9);
}

/* === Hamburger Button === */
.hamburger {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  padding: 6px;
}

.hamburger__line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger--open .hamburger__line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger--open .hamburger__line:nth-child(2) {
  opacity: 0;
}

.hamburger--open .hamburger__line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* === Drawer === */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: var(--bg-card);
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: var(--safe-top);
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer__header {
  padding: 20px 20px 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.drawer__list {
  list-style: none;
  padding: 8px 0;
}

.drawer__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}

.drawer__item:active {
  background: rgba(255, 255, 255, 0.05);
}

.drawer__item--active {
  background: rgba(45, 212, 191, 0.08);
  border-left-color: var(--accent-teal);
}

.drawer__item-date {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-teal);
  min-width: 42px;
}

.drawer__item-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* === Day Header === */
.day-header {
  padding: 20px 16px 16px;
}

.day-header__date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-teal);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.day-header__title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
}

.day-header__icon {
  font-size: 1.3rem;
  margin-right: 6px;
}

/* === Progress Bar === */
.progress {
  padding: 0 16px;
  margin-bottom: 16px;
}

.progress__bar-bg {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.progress__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-teal), #14b8a6);
  border-radius: 99px;
  transition: width 0.4s ease;
  width: 0%;
}

/* === Warnings & Tips Panel === */
.info-panel {
  margin: 0 16px 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.info-panel__section {
  padding: 14px 16px;
}

.info-panel__section--warnings {
  background: var(--bg-warning);
  border-left: 3px solid var(--accent-red);
}

.info-panel__section--tips {
  background: var(--bg-tip);
  border-left: 3px solid var(--accent-teal);
}

.info-panel__heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-panel__heading--warning {
  color: var(--accent-red);
}

.info-panel__heading--tip {
  color: var(--accent-teal);
}

.info-panel__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-panel__list li {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
}

.info-panel__list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* === Info Panel Toggle === */
.info-panel__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: none;
  color: var(--text-secondary);
  padding: 12px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.info-panel__toggle-arrow {
  transition: transform 0.3s ease;
  font-size: 0.7rem;
}

.info-panel__toggle[aria-expanded="true"] .info-panel__toggle-arrow {
  transform: rotate(180deg);
}

.info-panel__collapsible {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows 0.35s ease;
}

.info-panel__collapsible-inner {
  overflow: hidden;
}

.info-panel__collapsible.is-open {
  grid-template-rows: 1fr;
}

/* === Cards Container === */
.cards {
  padding: 0 16px 100px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* === Card === */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent-gray);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: all 0.35s ease;
}

.card--driving { border-left-color: var(--border-driving); }
.card--activity { border-left-color: var(--border-activity); }
.card--accommodation { border-left-color: var(--border-accommodation); }
.card--logistics { border-left-color: var(--border-logistics); }

/* Card inner wrapper */
.card__inner {
  padding: 14px 14px 12px;
}

/* Card Header Row */
.card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.card__emoji {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.card__header-text {
  flex: 1;
  min-width: 0;
}

.card__time {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-teal);
  letter-spacing: 0.5px;
}

.card__title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  transition: opacity 0.3s ease;
}

/* Card Body (collapsible via grid) */
.card__body {
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
  transition: grid-template-rows 0.4s ease, opacity 0.3s ease;
  opacity: 1;
}

.card__body > .card__body-inner {
  overflow: hidden;
}

.card__image {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  display: block;
}

/* Remove left indentation when card has an image */
.card__image ~ .card__description {
  padding-left: 0;
}

.card__image ~ .card__tip {
  margin-left: 0;
}

.card__image ~ .card__footer {
  padding-left: 0;
}

.card__description {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding-left: 46px;
}

.card__tip {
  background: var(--bg-tip);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 0 0 10px 46px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--accent-teal);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.card__tip::before {
  content: '💡';
  flex-shrink: 0;
}

/* Card Footer */
.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 46px;
  gap: 8px;
}

.card__maps-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-blue);
  border: none;
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}

.card__maps-btn:active {
  background: rgba(56, 189, 248, 0.25);
}

.card__maps-btn::before {
  content: '📍';
}

/* Check Button */
.card__check-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: transparent;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.25s ease;
  font-size: 1.1rem;
}

.card__check-btn:active {
  transform: scale(0.9);
}

/* === Checked State === */
.card--checked {
  background: var(--bg-checked);
  box-shadow: none;
  border-left-color: var(--accent-green) !important;
}

.card--checked .card__body {
  grid-template-rows: 0fr;
  opacity: 0;
}

.card--checked .card__title {
  opacity: 0.5;
  text-decoration: line-through;
  text-decoration-color: var(--text-muted);
}

.card--checked .card__time {
  opacity: 0.5;
}

.card--checked .card__emoji {
  opacity: 0.4;
}

.card--checked .card__check-btn {
  border-color: var(--accent-green);
  background: var(--accent-green);
  color: white;
}

.card--checked .card__header {
  margin-bottom: 0;
}

/* Undo button (visible only on checked cards) */
.card__undo-btn {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--text-muted);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s;
  margin-left: auto;
}

.card__undo-btn:active {
  transform: scale(0.9);
  border-color: var(--accent-teal);
  color: var(--accent-teal);
}

.card--checked .card__undo-btn {
  display: flex;
}

/* === Day Label (decorative) === */
.day-nav {
  display: flex;
  justify-content: center;
  padding: 12px 16px 8px;
}

.day-label {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 99px;
  background: var(--accent-teal);
  color: var(--bg-primary);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}

/* === Light Theme === */
[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-tip: rgba(13, 148, 136, 0.08);
  --bg-warning: rgba(239, 68, 68, 0.07);
  --bg-checked: #f0f0f0;

  --accent-teal: #0d9488;
  --accent-blue: #0284c7;
  --accent-green: #16a34a;
  --accent-red: #dc2626;
  --accent-violet: #7c3aed;
  --accent-gray: #94a3b8;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .app-header {
  background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .drawer {
  background: #ffffff;
}

[data-theme="light"] .drawer__header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .drawer-overlay {
  background: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .day-label {
  color: #fff;
}

[data-theme="light"] .info-panel__toggle {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .progress__bar-bg {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .card__check-btn {
  border-color: #cbd5e1;
}

[data-theme="light"] .card__undo-btn {
  border-color: #cbd5e1;
  color: #94a3b8;
}
