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

:root {
  --green-dark: #1a3a0f;
  --green-mid: #2d5a1b;
  --green-light: #4a8c2a;
  --green-accent: #6ab04c;
  --tan: #f5efe6;
  --tan-dark: #e8ddd0;
  --brown: #8b5e3c;
  --text: #1e1e1e;
  --text-light: #555;
  --white: #fff;
  --shadow: 0 2px 12px rgba(0,0,0,0.12);
  --radius: 10px;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f0ebe3;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
header {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 60%, var(--green-light) 100%);
  color: white;
  padding: 2rem 1rem;
  text-align: center;
}
.logo { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-bottom: .4rem; }
.logo-icon { font-size: 2.4rem; }
.logo-text { font-size: 2rem; font-weight: 800; letter-spacing: -0.5px; }
.tagline { font-size: .95rem; opacity: .85; letter-spacing: .5px; }

/* TABS */
.tabs {
  display: flex;
  background: var(--green-dark);
  padding: 0 1rem;
  overflow-x: auto;
  gap: .25rem;
}
.tab {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.7);
  padding: .9rem 1.4rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all .2s;
  white-space: nowrap;
}
.tab:hover { color: white; }
.tab.active {
  color: var(--green-accent);
  border-bottom-color: var(--green-accent);
}

/* MAIN */
main { flex: 1; max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem; width: 100%; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* SEARCH CARD */
.search-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.search-card h2 { font-size: 1.2rem; color: var(--green-dark); margin-bottom: 1rem; }
.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
}
.search-row input, .search-row select {
  flex: 1;
  min-width: 140px;
  padding: .6rem .9rem;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: .95rem;
  color: var(--text);
  background: white;
  transition: border-color .2s;
}
.search-row input:focus, .search-row select:focus {
  outline: none;
  border-color: var(--green-light);
}
.btn-primary {
  background: var(--green-mid);
  color: white;
  border: none;
  padding: .65rem 1.4rem;
  border-radius: 6px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* RESULTS GRID */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

/* CAMP CARD */
.camp-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.camp-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.camp-card-header {
  background: linear-gradient(135deg, var(--green-mid), var(--green-light));
  color: white;
  padding: 1rem;
}
.camp-card-header h3 { font-size: 1rem; margin-bottom: .2rem; }
.camp-card-header .state-badge {
  font-size: .75rem;
  background: rgba(255,255,255,.25);
  padding: .15rem .5rem;
  border-radius: 20px;
  display: inline-block;
}
.camp-card-body { padding: 1rem; }
.camp-detail { display: flex; gap: .4rem; font-size: .88rem; margin-bottom: .4rem; color: var(--text-light); }
.camp-detail strong { color: var(--text); }
.camp-actions { display: flex; gap: .5rem; margin-top: .8rem; }
.btn-book {
  background: var(--green-accent);
  color: white;
  border: none;
  padding: .5rem 1rem;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background .2s;
}
.btn-book:hover { background: var(--green-light); }
.btn-avail {
  background: transparent;
  color: var(--green-mid);
  border: 2px solid var(--green-mid);
  padding: .5rem 1rem;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.btn-avail:hover { background: var(--green-mid); color: white; }

/* FISH CARD */
.fish-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s;
}
.fish-card:hover { transform: translateY(-3px); }
.fish-card-header {
  background: linear-gradient(135deg, #1a4a6e, #2e7fc4);
  color: white;
  padding: 1rem;
}
.fish-card-header h3 { font-size: 1rem; margin-bottom: .3rem; }
.water-badge {
  font-size: .75rem;
  background: rgba(255,255,255,.25);
  padding: .15rem .5rem;
  border-radius: 20px;
  display: inline-block;
  margin-right: .3rem;
}
.fish-card-body { padding: 1rem; }
.species-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0; }
.species-tag {
  background: #e8f4fd;
  color: #1a4a6e;
  font-size: .78rem;
  padding: .15rem .5rem;
  border-radius: 20px;
  font-weight: 600;
}
.fish-detail { font-size: .87rem; color: var(--text-light); margin-bottom: .35rem; }
.fish-detail strong { color: var(--text); }

/* GAS PRICES */
#gas-results { max-width: 700px; margin: 0 auto; }
.gas-panel {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.gas-panel h3 { font-size: 1.1rem; color: var(--green-dark); margin-bottom: 1rem; }
.gas-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.gas-item {
  background: var(--tan);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.gas-label { font-size: .8rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .3rem; }
.gas-price { font-size: 2rem; font-weight: 800; color: var(--green-dark); }
.gas-unit { font-size: .75rem; color: var(--text-light); }
.gas-note {
  font-size: .82rem;
  color: var(--text-light);
  padding-top: 1rem;
  border-top: 1px solid #eee;
}
.gas-note a { color: var(--green-mid); }
.sample-badge {
  display: inline-block;
  background: #fff3cd;
  color: #856404;
  font-size: .78rem;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: .8rem;
}

/* AI CHAT */
.ai-container { max-width: 800px; margin: 0 auto; }
.ai-header {
  background: white;
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.ai-header h2 { font-size: 1.2rem; color: var(--green-dark); margin-bottom: .3rem; }
.ai-header p { font-size: .9rem; color: var(--text-light); }
.ai-messages {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  min-height: 300px;
  max-height: 450px;
  overflow-y: auto;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.ai-msg { display: flex; }
.ai-msg.user { justify-content: flex-end; }
.ai-msg.assistant { justify-content: flex-start; }
.msg-bubble {
  max-width: 80%;
  padding: .75rem 1rem;
  border-radius: 14px;
  font-size: .92rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.ai-msg.user .msg-bubble {
  background: var(--green-mid);
  color: white;
  border-bottom-right-radius: 4px;
}
.ai-msg.assistant .msg-bubble {
  background: var(--tan);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.ai-msg.assistant .msg-bubble.loading { color: var(--text-light); font-style: italic; }
.ai-input-row {
  display: flex;
  gap: .6rem;
  background: white;
  border-radius: var(--radius);
  padding: .8rem;
  box-shadow: var(--shadow);
  margin-bottom: .8rem;
}
.ai-input-row textarea {
  flex: 1;
  border: 2px solid #ddd;
  border-radius: 6px;
  padding: .5rem .8rem;
  font-size: .95rem;
  resize: none;
  font-family: inherit;
  transition: border-color .2s;
}
.ai-input-row textarea:focus { outline: none; border-color: var(--green-light); }
.ai-suggestions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.sugg-label { font-size: .82rem; color: var(--text-light); }
.suggestion {
  background: white;
  border: 1px solid #ddd;
  color: var(--green-mid);
  padding: .35rem .8rem;
  border-radius: 20px;
  font-size: .82rem;
  cursor: pointer;
  transition: all .2s;
  font-weight: 500;
}
.suggestion:hover { background: var(--green-mid); color: white; border-color: var(--green-mid); }

/* INFO / ERROR MESSAGES */
.info-msg {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 1rem;
  font-size: .9rem;
  margin-bottom: 1rem;
}
.info-msg a { color: var(--green-mid); }
.error-msg {
  background: #fde8e8;
  border: 1px solid #f5a5a5;
  border-radius: 8px;
  padding: 1rem;
  font-size: .9rem;
  color: #9b2335;
}
.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
}
.empty-state .icon { font-size: 3rem; margin-bottom: .8rem; }

/* AVAILABILITY BADGE */
.avail-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 20px;
  margin-bottom: .5rem;
}
.avail-available { background: #d4edda; color: #155724; }
.avail-limited { background: #fff3cd; color: #856404; }
.avail-full { background: #f8d7da; color: #721c24; }

/* TRIP TAB */
.trip-tab { position: relative; }
.trip-count {
  background: #e74c3c;
  color: white;
  font-size: .7rem;
  font-weight: 800;
  padding: .1rem .4rem;
  border-radius: 20px;
  margin-left: .3rem;
  vertical-align: middle;
}
.trip-count.hidden { display: none; }

.trip-header-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.trip-header-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.trip-name-label { font-size: .78rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: .3rem; }
.trip-name-input {
  font-size: 1.3rem;
  font-weight: 700;
  border: none;
  border-bottom: 2px solid #ddd;
  padding: .2rem .1rem;
  width: 280px;
  color: var(--green-dark);
  background: transparent;
  transition: border-color .2s;
}
.trip-name-input:focus { outline: none; border-bottom-color: var(--green-light); }
.trip-header-actions { display: flex; gap: .6rem; }
.btn-outline {
  background: transparent;
  border: 2px solid var(--green-mid);
  color: var(--green-mid);
  padding: .5rem 1rem;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.btn-outline:hover { background: var(--green-mid); color: white; }
.btn-danger {
  background: transparent;
  border: 2px solid #e74c3c;
  color: #e74c3c;
  padding: .5rem 1rem;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.btn-danger:hover { background: #e74c3c; color: white; }

.trip-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: .8rem;
  border-top: 1px solid #eee;
}
.trip-stat { font-size: .88rem; color: var(--text-light); }
.trip-stat strong { color: var(--text); }

.trip-section { margin-bottom: 1.5rem; }
.trip-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: .8rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.trip-section-title span { opacity: .6; font-size: .85rem; font-weight: 400; }

.trip-item {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  margin-bottom: .6rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.trip-item-info { flex: 1; }
.trip-item-name { font-weight: 700; font-size: .98rem; color: var(--text); margin-bottom: .2rem; }
.trip-item-meta { font-size: .83rem; color: var(--text-light); }
.trip-item-badge {
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 20px;
  display: inline-block;
  margin-right: .3rem;
}
.badge-campsite { background: #d4edda; color: #155724; }
.badge-statepark { background: #fde8cc; color: #7d4a00; }
.badge-fishing { background: #d0e8f5; color: #0a4d6e; }
.badge-gas { background: #f5f0d0; color: #5a4800; }

.trip-item-actions { display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; }
.btn-remove {
  background: transparent;
  border: 1px solid #ddd;
  color: #999;
  padding: .2rem .6rem;
  border-radius: 6px;
  font-size: .78rem;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn-remove:hover { border-color: #e74c3c; color: #e74c3c; }
.btn-go {
  background: var(--green-mid);
  color: white;
  border: none;
  padding: .3rem .7rem;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background .2s;
}
.btn-go:hover { background: var(--green-dark); }

.trip-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-light);
}
.trip-empty .icon { font-size: 3.5rem; margin-bottom: 1rem; }
.trip-empty h3 { font-size: 1.2rem; color: var(--text); margin-bottom: .5rem; }
.trip-empty p { font-size: .9rem; margin-bottom: 1.5rem; }
.trip-empty .hints { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.trip-empty .hint-chip {
  background: white;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: .35rem .9rem;
  font-size: .82rem;
  color: var(--text-light);
}

.btn-add-trip {
  background: transparent;
  border: 2px solid var(--green-accent);
  color: var(--green-mid);
  padding: .4rem .9rem;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn-add-trip:hover { background: var(--green-accent); color: white; }
.btn-add-trip.added { background: var(--green-accent); color: white; border-color: var(--green-accent); }

@media print {
  header, nav, .trip-header-actions, .trip-item-actions, footer { display: none !important; }
  .tab-content { display: block !important; }
  #tab-trip { display: block !important; }
}

/* DETAIL PANEL */
.detail-panel {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: #f0ebe3;
  overflow-y: auto;
}
.detail-panel.hidden { display: none; }
.detail-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--green-dark);
  color: white;
  padding: .7rem 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}
.detail-back {
  background: rgba(255,255,255,.15);
  color: white;
  border: 1px solid rgba(255,255,255,.3);
  padding: .4rem .9rem;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.detail-back:hover { background: rgba(255,255,255,.3); }
.detail-bar span {
  font-weight: 600;
  font-size: .95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-body {
  max-width: 800px;
  margin: 1.5rem auto;
  padding: 0 1rem 3rem;
  width: 100%;
}
.detail-hero {
  border-radius: var(--radius);
  padding: 2rem;
  color: white;
  margin-bottom: 1.5rem;
}
.detail-hero h1 { font-size: 1.6rem; margin-bottom: .4rem; }
.detail-hero .badge { font-size: .82rem; background: rgba(255,255,255,.25); padding: .2rem .7rem; border-radius: 20px; display: inline-block; }
.detail-section {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.detail-section h3 { font-size: 1rem; color: var(--green-dark); margin-bottom: .8rem; border-bottom: 2px solid var(--tan-dark); padding-bottom: .5rem; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; border-bottom: 1px solid #f0ebe3; font-size: .92rem; }
.detail-row:last-child { border-bottom: none; }
.detail-row strong { color: var(--text-light); font-weight: 500; }
.detail-row span { font-weight: 600; color: var(--text); }
.activity-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.activity-chip { background: var(--tan); color: var(--green-dark); padding: .3rem .8rem; border-radius: 20px; font-size: .85rem; font-weight: 600; }
.btn-reserve-big {
  display: block;
  width: 100%;
  background: var(--green-mid);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background .2s;
  margin-top: 1.5rem;
}
.btn-reserve-big:hover { background: var(--green-dark); }

/* FOOTER */
footer {
  background: var(--green-dark);
  color: rgba(255,255,255,.6);
  text-align: center;
  padding: 1rem;
  font-size: .82rem;
}

/* SPINNER */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  margin-right: .4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .logo-text { font-size: 1.5rem; }
  .gas-grid { grid-template-columns: 1fr 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .msg-bubble { max-width: 95%; }
}
