/* ==========================================================================
   Way-wise-AI : teal marketplace theme
   1 Base | 2 Header | 3 Categories | 4 Home | 5 Trip cards
   6 Detail | 7 Chat | 8 Overlay & toast | 9 Responsive
   ========================================================================== */


/* ---------- 1. Base ---------- */

:root {
  --blue: #0d9488;
  --blue-dark: #0f766e;
  --orange: #ff6b4a;
  --yellow: #fde047;
  --bg: #f1f3f6;
  --white: #ffffff;
  --text: #212121;
  --muted: #878787;
  --line: #e0e0e0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, "Segoe UI", system-ui, sans-serif;
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
}

a {
  cursor: pointer;
}

.hidden {
  display: none !important;
}


/* ---------- 2. Header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--blue);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 16px;
}

.logo {
  display: flex;
  align-items: center;
  color: var(--white);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.logo b {
  margin-left: 4px;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--yellow);
  color: #134e4a;
  font-size: 1rem;
}

.search {
  display: flex;
  flex: 1;
  max-width: 640px;
  border-radius: 999px;
  background: var(--white);
  overflow: hidden;
}

.search input {
  flex: 1;
  padding: 11px 14px;
  border: 0;
  font-size: 0.95rem;
  outline: none;
}

.search button {
  padding: 0 18px;
  border: 0;
  background: var(--white);
  color: var(--blue);
  font-size: 1.1rem;
  cursor: pointer;
}

.header-link {
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--white);
  color: var(--blue);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.header-link b {
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--orange);
  color: var(--white);
  font-size: 0.75rem;
}


/* ---------- 3. Categories ---------- */

.cats {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--white);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 90px;
  padding: 6px 10px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.cat span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #e6f7f5;
  font-size: 1.6rem;
  transition: 0.2s;
}

.cat:hover span {
  background: #ccefea;
  transform: translateY(-2px);
}

.cat:hover {
  color: var(--blue);
}


/* ---------- 4. Home ---------- */

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 36px 40px;
  border-radius: 12px;
  background: linear-gradient(100deg, #0f766e, #14b8a6 60%, #5eead4);
  color: var(--white);
}

.banner h1 {
  margin-bottom: 8px;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.banner p {
  max-width: 520px;
  opacity: 0.92;
  line-height: 1.5;
}

.banner-emoji {
  font-size: 4.5rem;
}

.perks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 12px 0 20px;
}

.perk {
  padding: 18px;
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow);
  text-align: center;
}

.perk span {
  display: block;
  margin-bottom: 6px;
  font-size: 1.8rem;
}

.perk p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.85rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: 1.2rem;
}

.section-head a {
  color: var(--blue);
  font-weight: 600;
}


/* ---------- 5. Trip cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.trip {
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
  overflow: hidden;
  transition: 0.2s;
}

.trip:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
}

.trip-top {
  display: grid;
  place-items: center;
  height: 110px;
  font-size: 3rem;
}

.trip-body {
  padding: 14px;
}

.trip-body h3 {
  display: -webkit-box;
  margin-bottom: 8px;
  font-size: 0.95rem;
  line-height: 1.4;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.trip-body p {
  color: var(--muted);
  font-size: 0.82rem;
}

.tag {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 3px;
  background: #388e3c;
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
}

.empty {
  grid-column: 1 / -1;
  padding: 40px;
  border-radius: 12px;
  background: var(--white);
  color: var(--muted);
  text-align: center;
}


/* ---------- 6. Detail ---------- */

.crumbs {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.crumbs a {
  color: var(--blue);
}

.detail {
  display: grid;
  grid-template-columns: 1fr 380px;
  align-items: start;
  gap: 12px;
}

.box {
  padding: 20px;
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.detail-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.detail-head h1 {
  font-size: 1.25rem;
  line-height: 1.4;
}

.detail-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.acts {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-orange,
.btn-blue {
  padding: 12px 20px;
  border: 0;
  border-radius: 8px;
  color: var(--white);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-orange {
  background: var(--orange);
}

.btn-blue {
  background: var(--blue);
}

.btn-orange:disabled,
.btn-blue:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-link {
  border: 0;
  background: none;
  color: #d32f2f;
  font-weight: 600;
  cursor: pointer;
}

.tabs {
  display: flex;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tab {
  padding: 12px 22px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.tab.on {
  border-bottom-color: var(--blue);
  color: var(--blue);
}

.paper {
  padding: 4px 2px;
  background: var(--white);
}

.md h1,
.md h2,
.md h3 {
  margin: 22px 0 10px;
  line-height: 1.3;
}

.md h1:first-child,
.md h2:first-child {
  margin-top: 0;
}

.md h2 {
  padding: 8px 12px;
  border-left: 4px solid var(--blue);
  background: #e6f7f5;
  font-size: 1.15rem;
}

.md h3 {
  color: var(--blue-dark);
  font-size: 1rem;
}

.md p {
  margin-bottom: 10px;
  color: #444;
  line-height: 1.7;
}

.md ul,
.md ol {
  margin: 8px 0 14px 22px;
  color: #444;
  line-height: 1.65;
}

.md table {
  width: 100%;
  margin: 14px 0;
  border-collapse: collapse;
}

.md th,
.md td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
}

.md th {
  background: #f5f7fa;
}

.raw {
  max-height: 65vh;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafa;
  color: #444;
  font: 0.85rem/1.6 Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}


/* ---------- 7. Chat ---------- */

.chat-card {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 100px);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-head {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  background: var(--blue);
  color: var(--white);
  font-weight: 700;
}

.chat-head small {
  margin-top: 2px;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.85;
}

.chatbox {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: #f7f9fc;
  overflow-y: auto;
}

.msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.msg.user {
  align-self: flex-end;
  border-bottom-right-radius: 3px;
  background: var(--blue);
  color: var(--white);
}

.msg.bot {
  align-self: flex-start;
  border: 1px solid var(--line);
  border-bottom-left-radius: 3px;
  background: var(--white);
}

.msg.bot p {
  margin-bottom: 6px;
}

.msg.bot ul,
.msg.bot ol {
  margin: 4px 0 6px 18px;
}

.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 0;
}

.quick button {
  padding: 6px 12px;
  border: 1px solid var(--blue);
  border-radius: 16px;
  background: var(--white);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.quick button:hover {
  background: #e6f7f5;
}

.chatrow {
  display: flex;
  gap: 8px;
  padding: 12px;
}

.chatrow input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.92rem;
  outline: none;
}

.chatrow input:focus {
  border-color: var(--blue);
}


/* ---------- 8. Overlay & toast ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
}

.overlay-box {
  padding: 32px 40px;
  border-radius: 6px;
  background: var(--white);
  text-align: center;
}

.overlay-box p {
  margin-top: 6px;
  color: var(--muted);
}

.spinner {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border: 5px solid #ccefea;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 60;
  max-width: 90vw;
  padding: 12px 20px;
  border-radius: 3px;
  background: #323232;
  color: var(--white);
  transform: translateX(-50%);
}

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


/* ---------- 9. Responsive ---------- */

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

  .chat-card {
    position: static;
    height: 520px;
  }

  .perks {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .header-link {
    margin-left: auto;
  }

  .cats {
    justify-content: flex-start;
  }

  .banner {
    padding: 24px;
  }

  .banner-emoji {
    display: none;
  }

  .tab {
    padding: 12px 14px;
  }
}