/* ============================================================
   TRIP PLANNER WIZARD — styles
   ============================================================ */

/* Overlay */
.tp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.52);
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.tp-overlay.tp-open {
  opacity: 1;
  pointer-events: all;
}

/* Panel */
.tp-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 460px;
  max-width: 100vw;
  background: #fff;
  z-index: 9001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 40px rgba(0,0,0,.18);
}
.tp-panel.tp-open {
  transform: translateX(0);
}

/* Header */
.tp-header {
  background: linear-gradient(135deg, #b91c1c, #DC143C);
  color: #fff;
  padding: 20px 24px 18px;
  flex-shrink: 0;
  position: relative;
}
.tp-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.tp-header-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .8;
}
.tp-close {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  flex-shrink: 0;
}
.tp-close:hover { background: rgba(255,255,255,.28); }
.tp-header h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
  line-height: 1.2;
}

/* Progress */
.tp-progress {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
.tp-progress-dot {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.3);
  transition: background .3s;
}
.tp-progress-dot.done  { background: rgba(255,255,255,.9); }
.tp-progress-dot.active { background: #fff; }

/* Body */
.tp-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 0;
}

/* Step */
.tp-step-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #DC143C;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 6px;
}
.tp-step-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 4px;
  line-height: 1.25;
}
.tp-step-sub {
  font-size: 0.82rem;
  color: #888;
  margin: 0 0 18px;
}

/* Option cards */
.tp-options {
  display: grid;
  gap: 10px;
}
.tp-options--2col { grid-template-columns: 1fr 1fr; }
.tp-options--3col { grid-template-columns: 1fr 1fr 1fr; }

.tp-option {
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  padding: 14px 14px 12px;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .15s;
  text-align: left;
  background: #fafafa;
  user-select: none;
}
.tp-option:hover {
  border-color: #DC143C;
  background: #fff5f5;
  transform: translateY(-1px);
}
.tp-option.tp-selected {
  border-color: #DC143C;
  background: #fff5f5;
  box-shadow: 0 0 0 1px #DC143C;
}
.tp-option-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 8px;
}
.tp-option-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 2px;
}
.tp-option-desc {
  font-size: 0.76rem;
  color: #888;
  line-height: 1.4;
}

/* Footer navigation */
.tp-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  background: #fff;
}
.tp-btn {
  padding: 11px 22px;
  border-radius: 8px;
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .15s, opacity .2s;
}
.tp-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.tp-btn--back {
  background: #f4f4f4;
  color: #444;
}
.tp-btn--back:hover:not(:disabled) { background: #e8e8e8; }
.tp-btn--next {
  background: #DC143C;
  color: #fff;
  flex: 1;
}
.tp-btn--next:hover:not(:disabled) {
  background: #b91c1c;
  transform: translateY(-1px);
}

/* Results */
.tp-results { padding-bottom: 24px; }

.tp-results-intro {
  font-size: 0.87rem;
  color: #555;
  line-height: 1.6;
  margin: 0 0 20px;
}

.tp-itinerary {
  border: 1px solid #eee;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
}

.tp-itin-header {
  padding: 18px 20px 16px;
  color: #fff;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
.tp-itin-header--trekking  { background: linear-gradient(135deg, #1e3a5f, #1d4ed8); }
.tp-itin-header--culture   { background: linear-gradient(135deg, #7c2d12, #c2410c); }
.tp-itin-header--wildlife  { background: linear-gradient(135deg, #14532d, #15803d); }
.tp-itin-header--adventure { background: linear-gradient(135deg, #4c1d95, #7c3aed); }
.tp-itin-header--mixed     { background: linear-gradient(135deg, #1e3a5f, #DC143C); }
.tp-itin-header--spiritual { background: linear-gradient(135deg, #78350f, #d97706); }

.tp-itin-emoji { font-size: 1.8rem; margin-bottom: 8px; line-height: 1; }
.tp-itin-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}
.tp-itin-sub {
  font-size: 0.78rem;
  color: rgba(255,255,255,.8);
  margin: 0 0 10px;
}
.tp-itin-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-itin-tag {
  background: rgba(255,255,255,.15);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
}
.tp-itin-tag--warn { background: rgba(255,200,0,.25); color: #ffe066; }

.tp-itin-body { background: #fff; padding: 16px 20px 20px; }

.tp-itin-section { margin-bottom: 14px; }
.tp-itin-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #DC143C;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}

.tp-highlights { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }
.tp-highlights li {
  font-size: 0.82rem;
  color: #444;
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}
.tp-highlights li::before { content: '✦'; position: absolute; left: 0; color: #DC143C; font-size: .55rem; top: 4px; }

.tp-days { display: flex; flex-direction: column; gap: 0; }
.tp-day {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f4f4f4;
  align-items: flex-start;
}
.tp-day:last-child { border-bottom: none; }
.tp-day-label {
  flex-shrink: 0;
  width: 52px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #DC143C;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-top: 2px;
}
.tp-day-content { flex: 1; min-width: 0; }
.tp-day-title { font-size: 0.85rem; font-weight: 700; color: #1a1a1a; margin-bottom: 2px; }
.tp-day-desc { font-size: 0.79rem; color: #666; line-height: 1.5; }

.tp-itin-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tp-itin-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, transform .15s;
  border: 1.5px solid #DC143C;
  color: #DC143C;
  background: #fff;
}
.tp-itin-link:hover {
  background: #DC143C;
  color: #fff;
  transform: translateY(-1px);
}

.tp-alt-section { margin-top: 20px; }
.tp-alt-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.tp-alt-card {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: #fafafa;
}
.tp-alt-card:hover { border-color: #DC143C; background: #fff5f5; }
.tp-alt-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.tp-alt-card-emoji { font-size: 1.2rem; line-height: 1; }
.tp-alt-card-title { font-size: 0.88rem; font-weight: 700; color: #1a1a1a; }
.tp-alt-card-sub { font-size: 0.78rem; color: #888; }

.tp-restart {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 11px;
  border: 1.5px solid #eee;
  border-radius: 8px;
  background: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  text-align: center;
  transition: border-color .2s, color .2s;
}
.tp-restart:hover { border-color: #DC143C; color: #DC143C; }

.tp-alt-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #DC143C;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0 14px;
  transition: opacity .2s;
}
.tp-alt-back:hover { opacity: .7; }

/* Loading spinner */
.tp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 16px;
}
.tp-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f0f0f0;
  border-top-color: #DC143C;
  border-radius: 50%;
  animation: tp-spin .8s linear infinite;
}
@keyframes tp-spin { to { transform: rotate(360deg); } }
.tp-loading-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1a1a1a;
}
.tp-loading-sub {
  font-size: 0.81rem;
  color: #888;
}

/* API Key entry */
.tp-key-wrap {
  padding: 8px 0 24px;
}
.tp-key-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
  line-height: 1;
}
.tp-key-desc {
  font-size: 0.83rem;
  color: #555;
  line-height: 1.6;
  margin: 8px 0 16px;
}
.tp-key-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: monospace;
  outline: none;
  transition: border-color .2s;
}
.tp-key-input:focus { border-color: #DC143C; }
.tp-key-hint {
  font-size: 0.78rem;
  color: #888;
  margin-top: 8px;
}
.tp-key-hint a { color: #DC143C; }
.tp-key-error {
  margin-top: 10px;
  font-size: 0.82rem;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 8px 12px;
}

/* AI output */
.tp-ai-output {
  padding-bottom: 24px;
}
.tp-ai-h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 20px 0 8px;
}
.tp-ai-h4 {
  font-size: 0.93rem;
  font-weight: 700;
  color: #DC143C;
  margin: 14px 0 6px;
}
.tp-ai-p {
  font-size: 0.85rem;
  color: #444;
  line-height: 1.65;
  margin: 0 0 10px;
}
.tp-ai-output ul, .tp-chat-ai ul {
  padding-left: 18px;
  margin: 6px 0 10px;
}
.tp-ai-output li, .tp-chat-ai li {
  font-size: 0.84rem;
  color: #444;
  line-height: 1.6;
  margin-bottom: 3px;
}

/* Typing cursor */
.tp-cursor {
  display: inline-block;
  color: #DC143C;
  animation: tp-blink .7s step-end infinite;
  font-size: 0.9em;
  vertical-align: baseline;
}
@keyframes tp-blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* Chat layout */
.tp-chat-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tp-chat-bubble {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.84rem;
  line-height: 1.6;
  max-width: 100%;
  word-break: break-word;
}
.tp-chat-ai {
  background: #f8f9fc;
  border: 1px solid #eee;
  color: #333;
  border-radius: 4px 12px 12px 12px;
}
.tp-chat-user {
  background: #DC143C;
  color: #fff;
  border-radius: 12px 12px 4px 12px;
  align-self: flex-end;
  max-width: 85%;
}
.tp-chat-ai .tp-ai-h3 { font-size: 1rem; }
.tp-chat-ai .tp-ai-h4 { font-size: 0.87rem; }
.tp-chat-ai .tp-ai-p  { font-size: 0.83rem; margin-bottom: 8px; }
.tp-error-inline { color: #dc2626; font-size: 0.82rem; }

/* Chat input bar */
.tp-chat-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
}
.tp-chat-input {
  flex: 1;
  padding: 9px 13px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color .2s;
}
.tp-chat-input:focus { border-color: #DC143C; }
.tp-chat-input:disabled { background: #f8f8f8; }
.tp-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #DC143C;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}
.tp-chat-send:hover:not(:disabled) { background: #b91c1c; }
.tp-chat-send:disabled { opacity: .4; cursor: not-allowed; }

/* Error box */
.tp-error-box {
  padding: 40px 24px;
  text-align: center;
}
.tp-error-icon { font-size: 2.5rem; margin-bottom: 12px; }
.tp-error-msg {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.6;
}

/* Scrollbar */
.tp-body::-webkit-scrollbar { width: 4px; }
.tp-body::-webkit-scrollbar-track { background: transparent; }
.tp-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* Responsive */
@media (max-width: 520px) {
  .tp-panel { width: 100vw; }
  .tp-options--3col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .tp-options--2col,
  .tp-options--3col { grid-template-columns: 1fr; }
}
