/* MyPageStory · Thailand — Tropical Glassmorphic Design System
   Matches the subdomain visual identity: rotating sun/sea Thailand backdrops
   with dark frosted-glass panels, warm gold badges, and emerald-teal accents. */

:root {
  --glass-bg: rgba(13, 24, 34, 0.76);
  --glass-card: rgba(17, 30, 42, 0.72);
  --glass-card-hover: rgba(22, 38, 52, 0.88);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-border-strong: rgba(255, 255, 255, 0.28);
  --ink: #f8fafc;
  --ink-muted: #cbd5e1;
  --ink-subtle: #94a3b8;
  --accent: #14b8a6;       /* Tropical Andaman Teal */
  --accent-hover: #0d9488;
  --gold: #f59e0b;         /* Temple Gold */
  --gold-bg: rgba(245, 158, 11, 0.16);
  --gold-border: rgba(245, 158, 11, 0.42);
  --radius: 18px;
  --radius-sm: 10px;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.48);
  --max-w: 1140px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Thai", "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", sans-serif;
  color: var(--ink);
  background: #0b1620;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Rotating Full-Bleed Tropical Background */
.bg-slideshow {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: #0b1620;
}

.bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 1.8s ease-in-out, transform 12s ease-out;
}

.bg-slide.active {
  opacity: 1;
  transform: scale(1);
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(8, 18, 28, 0.35) 0%, rgba(8, 18, 28, 0.62) 100%);
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* Sticky Glass Header — Never wraps buttons */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 22, 32, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--glass-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  flex-wrap: nowrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: #ffffff;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.7);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-muted);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: #ffffff;
  border-bottom-color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.84rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}

.icon-btn:hover {
  border-color: var(--glass-border-strong);
  background: rgba(255, 255, 255, 0.16);
}

.lang-dropdown {
  position: relative;
  flex-shrink: 0;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--glass-border-strong);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 175px;
  background: rgba(13, 24, 34, 0.96);
  backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border-strong);
  border-radius: 14px;
  padding: 6px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 90;
  max-height: 340px;
  overflow-y: auto;
}

.lang-menu.open {
  display: grid;
  gap: 2px;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}

.lang-option:hover,
.lang-option.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

#auth-header-slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 0.82rem;
}

.btn-primary {
  background: var(--accent);
  color: #042f2e;
}

.btn-primary:hover {
  background: #2dd4bf;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--glass-border-strong);
  color: #ffffff;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
}

.btn-ghost:hover {
  background: rgba(20, 184, 166, 0.12);
}

.mobile-menu-btn {
  display: none;
}

/* Main Glass Panel Wrapper (Hero matching Screenshot 2) */
.hero-wrap {
  padding: 38px 0 28px;
}

.glass-hero {
  background: var(--glass-bg);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 36px 38px 32px;
  box-shadow: var(--shadow-lg);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  color: #fbbf24;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.glass-hero h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
  color: #ffffff;
}

.hero-lead {
  font-size: 1.02rem;
  color: var(--ink-muted);
  margin: 0 0 22px;
  max-width: 68ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.highlight-card {
  background: rgba(10, 20, 30, 0.62);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.18s, border-color 0.18s;
  cursor: pointer;
}

.highlight-card:hover {
  transform: translateY(-3px);
  border-color: var(--glass-border-strong);
}

.highlight-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.highlight-body {
  padding: 14px 16px 16px;
}

.highlight-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2dd4bf;
  margin-bottom: 4px;
}

.highlight-body h3 {
  margin: 0 0 6px;
  font-size: 1.04rem;
  color: #ffffff;
}

.highlight-body p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-muted);
  line-height: 1.48;
}

.hero-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  font-size: 0.82rem;
  color: var(--ink-subtle);
}

/* Sections */
.section {
  padding: 28px 0;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: #ffffff;
}

.section-header p {
  margin: 0;
  color: var(--ink-muted);
  max-width: 62ch;
}

/* Filter Pills */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.pill {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.pill:hover {
  border-color: var(--glass-border-strong);
  color: #ffffff;
}

.pill.active {
  background: #ffffff;
  border-color: #ffffff;
  color: #0f172a;
  font-weight: 600;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

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

.card {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, background 0.18s, border-color 0.18s;
}

.card:hover {
  transform: translateY(-2px);
  background: var(--glass-card-hover);
  border-color: var(--glass-border-strong);
}

.card-img-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0b1620;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.card:hover .card-img-wrap img {
  transform: scale(1.04);
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(11, 22, 32, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 600;
}

.bookmark-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(11, 22, 32, 0.65);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.bookmark-btn.saved {
  background: var(--gold);
  border-color: var(--gold);
  color: #111827;
}

.card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta {
  font-size: 0.78rem;
  color: #2dd4bf;
  font-weight: 600;
  margin-bottom: 6px;
}

.card-title {
  font-size: 1.08rem;
  margin: 0 0 8px;
  line-height: 1.3;
  color: #ffffff;
}

.card-text {
  font-size: 0.89rem;
  color: var(--ink-muted);
  margin: 0 0 14px;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
  font-size: 0.82rem;
  color: var(--ink-subtle);
  gap: 10px;
}

/* Timeline */
.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.timeline-item {
  background: rgba(10, 20, 30, 0.55);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 18px;
}

.timeline-year {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fbbf24;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.timeline-item h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  color: #ffffff;
}

.timeline-item p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-muted);
}

/* Route Tabs */
.route-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.route-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.day-card {
  background: rgba(10, 20, 30, 0.58);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px;
}

.day-card span {
  font-size: 0.75rem;
  font-weight: 700;
  color: #2dd4bf;
  text-transform: uppercase;
}

.day-card h4 {
  margin: 4px 0 6px;
  font-size: 0.98rem;
  color: #ffffff;
}

.day-card p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-muted);
}

/* Page Banner */
.page-banner {
  padding: 28px 0 12px;
}

.breadcrumb {
  font-size: 0.84rem;
  color: var(--ink-subtle);
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.breadcrumb a:hover {
  color: #ffffff;
}

/* Tables */
.info-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(10, 20, 30, 0.55);
}

table.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.info-table th,
.info-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

.info-table th {
  background: rgba(255, 255, 255, 0.06);
  font-weight: 600;
  color: #ffffff;
}

.info-table td {
  color: var(--ink-muted);
}

.info-table tr:last-child td {
  border-bottom: none;
}

/* Forms & Newsletter */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--glass-border-strong);
  border-radius: 10px;
  background: rgba(10, 20, 30, 0.72);
  color: #ffffff;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
}

.newsletter-box {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
}

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

.newsletter-form input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border-strong);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.newsletter-form input::placeholder {
  color: var(--ink-subtle);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 18, 0.72);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: rgba(15, 27, 38, 0.96);
  border-radius: 18px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--glass-border-strong);
  color: var(--ink);
}

.modal-sm {
  max-width: 430px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  background: rgba(15, 27, 38, 0.98);
  z-index: 2;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.12rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 22px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.auth-tab {
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--ink-muted);
}

.auth-tab.active {
  background: #ffffff;
  color: #0f172a;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  background: rgba(15, 27, 38, 0.95);
  border: 1px solid var(--accent);
  color: #ffffff;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
.site-footer {
  margin-top: 24px;
  background: rgba(10, 20, 30, 0.82);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--glass-border);
  padding: 40px 0 24px;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 28px;
}

.footer-col h4 {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: #ffffff;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 7px;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 18px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--ink-subtle);
}

@media (max-width: 1140px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(11, 22, 32, 0.96);
    border-bottom: 1px solid var(--glass-border);
    padding: 16px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .nav-links.open {
    display: flex;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .hero-highlights,
  .cards-grid,
  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .newsletter-box,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 14px;
  }
  .header-inner {
    gap: 8px;
    height: 58px;
  }
  .brand {
    font-size: 0.92rem;
  }
  .glass-hero,
  .glass-panel {
    padding: 20px 16px;
    border-radius: 16px;
  }
  .hero-highlights,
  .cards-grid,
  .cards-grid-2,
  .timeline {
    grid-template-columns: 1fr;
  }
  .newsletter-form {
    flex-direction: column;
  }
  .btn-text-hide {
    display: none;
  }
  .info-table th,
  .info-table td {
    padding: 10px 12px;
    font-size: 0.84rem;
  }
}

@media (max-width: 420px) {
  .brand span:last-child {
    max-width: 135px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .lang-btn {
    padding: 0 9px;
    font-size: 0.78rem;
  }
  .btn-sm {
    padding: 0 10px;
    font-size: 0.78rem;
  }
}
