/* ============================================================
   Dave the Diver Strategy Guide — Global Stylesheet
   Palette: Ocean Teal #0a6e79 / Aqua #14b8a6 / Ice Blue #f0f9ff
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --primary: #0a6e79;
  --primary-dark: #06505a;
  --primary-light: #0d8b99;
  --accent: #14b8a6;
  --accent-light: #5eead4;
  --bg: #f0f9fa;
  --bg-card: #ffffff;
  --bg-alt: #e6f4f7;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #cbd5e1;
  --border-light: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --nav-height: 64px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 20px);
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--nav-height);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--primary-dark); }

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

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.nav-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  display: block;
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: var(--bg);
}

/* Search in nav */
.nav-search {
  position: relative;
  margin-left: 8px;
}

.nav-search input {
  width: 180px;
  padding: 6px 12px 6px 34px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
  background: var(--bg);
  font-family: var(--font-sans);
}

.nav-search input:focus {
  border-color: var(--primary);
  background: #fff;
  width: 220px;
}

.nav-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 14px;
  pointer-events: none;
}

.search-results-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
  z-index: 200;
}

.search-results-dropdown.show { display: block; }

.search-result-item {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  font-size: 13px;
  transition: background 0.15s;
}

.search-result-item:hover { background: var(--bg); }
.search-result-item:last-child { border-bottom: none; }
.search-result-item .result-type {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}

/* Hamburger menu */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s;
}

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Page Header --- */
.page-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 40px 0;
  margin-bottom: 32px;
}

.page-header .container h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.page-header .container p {
  opacity: 0.85;
  font-size: 15px;
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(160deg, #054f5a 0%, #0a6e79 40%, #0d8b99 70%, #14b8a6 100%);
  color: #fff;
  padding: 64px 0 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.hero h1 {
  font-size: 40px;
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.hero p {
  font-size: 18px;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto 28px;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: #0d9488;
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.4);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-color: rgba(255,255,255,0.6);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.card-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Quick entry cards */
.quick-entry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.quick-entry .card {
  text-align: center;
  padding: 28px 20px;
  border-top: 3px solid var(--primary);
}

.quick-entry .card:nth-child(2) { border-top-color: var(--accent); }
.quick-entry .card:nth-child(3) { border-top-color: #e67e22; }

.quick-entry .card-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

/* --- Sections --- */
.section {
  margin-bottom: 48px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--primary);
  display: inline-block;
}

.section-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* --- Article Content --- */
.article {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
  line-height: 1.85;
}

.article h2 {
  font-size: 22px;
  color: var(--primary-dark);
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
}

.article h2:first-child { margin-top: 0; }

.article h3 {
  font-size: 18px;
  color: var(--text);
  margin: 24px 0 10px;
}

.article p {
  margin-bottom: 14px;
  color: #334155;
}

.article ul, .article ol {
  margin: 0 0 16px 20px;
}

.article li {
  margin-bottom: 6px;
  color: #334155;
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.article table th,
.article table td {
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  text-align: left;
}

.article table th {
  background: var(--bg-alt);
  font-weight: 600;
  color: var(--primary-dark);
  white-space: nowrap;
}

.article table tr:hover td {
  background: var(--bg);
}

/* Tips / Warning / Boss boxes */
.tip-box {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.7;
}

.tip-box.tip {
  background: #ecfdf5;
  border-left: 4px solid #10b981;
  color: #065f46;
}

.tip-box.warning {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  color: #7f1d1d;
}

.tip-box.info {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  color: #1e3a5f;
}

.tip-box.boss {
  background: #fff7ed;
  border-left: 4px solid #f97316;
  color: #7c2d12;
}

.tip-box strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

/* --- Anchored TOC --- */
.toc-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.toc-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-height) + 20px);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  max-height: calc(100vh - var(--nav-height) - 40px);
  overflow-y: auto;
}

.toc-sidebar h4 {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.toc-sidebar a {
  display: block;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  transition: color 0.15s;
}

.toc-sidebar a:hover,
.toc-sidebar a.active {
  color: var(--primary);
}

.toc-content {
  flex: 1;
  min-width: 0;
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  align-items: center;
}

.filter-bar select,
.filter-bar input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
}

.filter-bar select:focus,
.filter-bar input:focus {
  border-color: var(--primary);
}

.filter-bar input {
  min-width: 220px;
}

/* --- Fish / Item Card Grid --- */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.guide-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  transition: box-shadow 0.2s;
}

.guide-card:hover {
  box-shadow: var(--shadow-md);
}

.guide-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.guide-card h4 {
  font-size: 16px;
  color: var(--text);
}

.guide-card .price {
  color: #e67e22;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.guide-card .meta {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
}

.guide-card .meta span {
  display: inline-block;
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: 4px;
  margin: 2px 4px 2px 0;
  font-size: 12px;
}

.guide-card .catch-tip {
  margin-top: 10px;
  font-size: 13px;
  color: var(--primary);
  background: var(--bg);
  padding: 8px 12px;
  border-radius: 6px;
  line-height: 1.6;
}

/* Guide Table (Desktop) */
.guide-table-wrap {
  overflow-x: auto;
  margin-bottom: 32px;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.guide-table thead th {
  background: var(--primary);
  color: #fff;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.guide-table thead th:hover {
  background: var(--primary-dark);
}

.guide-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
}

.guide-table tbody tr:hover td {
  background: var(--bg);
}

.no-results {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 15px;
}

/* --- FAQ Accordion --- */
.faq-list {
  max-width: 800px;
}

.faq-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 18px 48px 18px 20px;
  border: none;
  background: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.5;
}

.faq-question::after {
  content: '+';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--primary);
  transition: transform 0.25s;
}

.faq-item.open .faq-question::after {
  content: '−';
  transform: translateY(-50%);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 600px;
}

.faq-answer-inner {
  padding: 0 20px 20px;
  font-size: 15px;
  color: #334155;
  line-height: 1.8;
}

/* --- Update Notice --- */
.notice-list {
  list-style: none;
}

.notice-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  gap: 14px;
  align-items: baseline;
  font-size: 14px;
}

.notice-list li:last-child { border-bottom: none; }

.notice-date {
  color: var(--text-light);
  font-size: 12px;
  white-space: nowrap;
  min-width: 80px;
}

.notice-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.notice-tag.new { background: #dcfce7; color: #166534; }
.notice-tag.hot { background: #fef3c7; color: #92400e; }
.notice-tag.guide { background: #dbeafe; color: #1e40af; }

/* --- Footer --- */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 24px 0;
  font-size: 13px;
  margin-top: 60px;
}

.footer a {
  color: rgba(255,255,255,0.9);
}

/* --- Back to top --- */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 20px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s;
  pointer-events: none;
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--primary-dark);
}

/* --- Mobile nav overlay --- */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

.mobile-nav-overlay.show { display: block; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .toc-layout { flex-direction: column; }
  .toc-sidebar {
    width: 100%;
    position: static;
    max-height: none;
  }
  .card-grid.cols-3,
  .card-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .quick-entry { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 12px;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--border-light);
  }

  .nav-links.show { display: flex; }

  .nav-search { margin-left: 0; width: 100%; }
  .nav-search input { width: 100%; }
  .nav-search input:focus { width: 100%; }

  .hamburger { display: flex; }

  .hero h1 { font-size: 28px; }
  .hero p { font-size: 15px; }

  .article { padding: 20px; }

  .card-grid,
  .card-grid.cols-2,
  .card-grid.cols-3,
  .card-grid.cols-4 { grid-template-columns: 1fr; }

  .quick-entry { grid-template-columns: 1fr; }

  .guide-grid { grid-template-columns: 1fr; }

  .filter-bar { flex-direction: column; }
  .filter-bar input,
  .filter-bar select { width: 100%; }

  .toc-layout { gap: 16px; }

  .page-header { padding: 28px 0; }
  .page-header .container h1 { font-size: 22px; }
}

@media (max-width: 480px) {
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 24px; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .hero-buttons .btn { width: 100%; justify-content: center; }
}
