/* ═══════════════════════════════════════════════
   TRIPPOCKET — "EXPLORER'S JOURNAL" DESIGN SYSTEM
   Shared CSS for website + admin dashboard
   ═══════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  /* Light (Parchment) */
  --bg:            #FAF5EC;
  --surface:       #FFFFFF;
  --surface-alt:   #F5EDE0;
  --surface-hover: #F0E8D8;
  --border:        rgba(160,110,50,.14);
  --border2:       rgba(160,110,50,.24);

  --gold:          #B07820;
  --gold-light:    #D4A843;
  --gold-pale:     #F5EDE0;
  --gold-vivid:    #C8922E;

  --text:          #1C1108;
  --text-2:        #6B4F32;
  --text-3:        #9A7D5A;
  --text-inv:      #FFFFFF;

  --success:       #047857;
  --success-bg:    rgba(4,120,87,.10);
  --warning:       #92400E;
  --warning-bg:    rgba(146,64,14,.10);
  --danger:        #B91C1C;
  --danger-bg:     rgba(185,28,28,.10);
  --info:          #0369A1;
  --info-bg:       rgba(3,105,161,.10);

  /* Typography */
  --font-serif:    'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:     'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono:     'DM Mono', 'Fira Code', monospace;

  /* Radii */
  --r1: 6px; --r2: 12px; --r3: 18px; --r4: 24px;

  /* Shadows */
  --sh:  0 2px 16px rgba(100,60,10,.09), 0 1px 0 rgba(255,255,255,.8) inset;
  --sh2: 0 4px 24px rgba(100,60,10,.14);
  --sh3: 0 8px 40px rgba(100,60,10,.18);
  --gold-sh: 0 0 20px rgba(176,120,32,.22), 0 0 40px rgba(176,120,32,.09);

  /* Transitions */
  --ease: cubic-bezier(.4,0,.2,1);
  --t-fast: .15s var(--ease);
  --t-med:  .3s var(--ease);
  --t-slow: .5s var(--ease);
}

/* ── Dark mode ── */
[data-theme="dark"] {
  --bg:            #0B0E1A;
  --surface:       #1A2035;
  --surface-alt:   #222940;
  --surface-hover: #2A3250;
  --border:        rgba(212,168,67,.12);
  --border2:       rgba(212,168,67,.22);

  --gold:          #D4A843;
  --gold-light:    #E8C36A;
  --gold-pale:     rgba(212,168,67,.12);

  --text:          #E8E0D4;
  --text-2:        #B0A090;
  --text-3:        #706050;

  --sh:  0 2px 16px rgba(0,0,0,.3);
  --sh2: 0 4px 24px rgba(0,0,0,.4);
  --sh3: 0 8px 40px rgba(0,0,0,.5);
  --gold-sh: 0 0 20px rgba(212,168,67,.25), 0 0 40px rgba(212,168,67,.12);
}

/* ── Reset ── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
}

/* ── Topo map background ── */
.topo-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='800'%3E%3Cdefs%3E%3Cstyle%3E.c%7Bfill:none;stroke:%23A06422;stroke-width:0.7;opacity:0.09%7D%3C/style%3E%3C/defs%3E%3Ccircle class='c' cx='400' cy='400' r='80'/%3E%3Ccircle class='c' cx='400' cy='400' r='130'/%3E%3Ccircle class='c' cx='400' cy='400' r='190'/%3E%3Ccircle class='c' cx='400' cy='400' r='260'/%3E%3Ccircle class='c' cx='400' cy='400' r='340'/%3E%3Ccircle class='c' cx='400' cy='400' r='430'/%3E%3Ccircle class='c' cx='400' cy='400' r='530'/%3E%3Ccircle class='c' cx='400' cy='400' r='640'/%3E%3Ccircle class='c' cx='150' cy='120' r='50'/%3E%3Ccircle class='c' cx='150' cy='120' r='80'/%3E%3Ccircle class='c' cx='680' cy='650' r='60'/%3E%3Ccircle class='c' cx='680' cy='650' r='95'/%3E%3C/svg%3E");
  background-size: 800px;
  background-position: center;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 700; line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }

.text-gold { color: var(--gold); }
.text-muted { color: var(--text-2); }
.text-small { font-size: 13px; color: var(--text-3); }
.text-center { text-align: center; }

/* ── Links ── */
a { color: var(--gold); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--gold-light); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--r2);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #fff;
  box-shadow: var(--gold-sh);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(176,120,32,.35);
  color: #fff;
}
.btn-secondary {
  background: var(--surface);
  color: var(--gold);
  border: 2px solid var(--border2);
}
.btn-secondary:hover {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: var(--gold);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  padding: 8px 16px;
}
.btn-ghost:hover { color: var(--gold); }
.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 17px; }
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #991B1B;
  transform: translateY(-1px);
  color: #fff;
}
.btn-success {
  background: var(--success);
  color: #fff;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: 24px;
  box-shadow: var(--sh);
  transition: all var(--t-med);
}
.card:hover {
  box-shadow: var(--sh2);
  transform: translateY(-2px);
}
.card-flat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 20px;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.badge-gold { background: var(--gold-pale); color: var(--gold); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* ── Form elements ── */
.input, .select, .textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border2);
  border-radius: var(--r1);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(176,120,32,.12);
}
.input::placeholder { color: var(--text-3); }
.textarea { min-height: 80px; resize: vertical; }
.label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

/* ── Table ── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--surface-alt);
  font-weight: 600;
  color: var(--text-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-alt); }

/* ── Section ── */
.section {
  padding: 80px 0;
  position: relative;
  z-index: 1;
}
.section-alt { background: var(--surface-alt); }
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-sm { max-width: 800px; }
.container-lg { max-width: 1400px; }

/* ── Grid ── */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
}

/* ── Flex ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }

/* ── Spacing ── */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.animate-fade-up { animation: fadeInUp .6s var(--ease) both; }
.animate-fade { animation: fadeIn .6s var(--ease) both; }
.animate-float { animation: float 4s ease-in-out infinite; }

/* delay utilities */
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }
.delay-4 { animation-delay: .4s; }
.delay-5 { animation-delay: .5s; }
.delay-6 { animation-delay: .6s; }

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Misc ── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
img { max-width: 100%; height: auto; display: block; }
.gold-gradient { background: linear-gradient(135deg, var(--gold-light), var(--gold)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.separator {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
  margin: 16px auto;
}