/* =========================================================
   Waterline RV Resort — Start Page Stylesheet
   Primary: rgb(15, 52, 80)  |  Accent: #e8a430 (warm gold)
   Fonts: Playfair Display (headings) / DM Sans (body)
   ========================================================= */

:root {
  /* Brand colors */
  --brand-deep:    rgb(15, 52, 80);
  --brand-mid:     rgb(22, 72, 108);
  --brand-light:   rgb(38, 108, 158);
  --brand-accent:  #e8a430;
  --brand-accent2: #5bb8d4;

  /* Dark theme (default) */
  --bg:            #08202f;
  --bg-card:       rgba(15, 52, 80, 0.55);
  --bg-card-hover: rgba(22, 72, 108, 0.75);
  --bg-header:     rgba(8, 32, 47, 0.85);
  --border:        rgba(91, 184, 212, 0.18);
  --border-hover:  rgba(91, 184, 212, 0.45);
  --text-primary:  #e8f4f8;
  --text-secondary:#9dccd8;
  --text-muted:    #5a8fa0;
  --shadow:        0 4px 24px rgba(0,0,0,0.45);
  --shadow-hover:  0 8px 36px rgba(0,0,0,0.6);
  --wave-1:        rgba(15, 52, 80, 0.9);
  --wave-2:        rgba(8, 32, 47, 0.95);
  --search-bg:     rgba(15, 52, 80, 0.6);

  /* Spacing & shape */
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 130px;
}

[data-theme="light"] {
  --bg:            #deeef5;
  --bg-card:       rgba(255,255,255,0.78);
  --bg-card-hover: rgba(255,255,255,0.95);
  --bg-header:     rgba(15, 52, 80, 0.92);
  --border:        rgba(15, 52, 80, 0.12);
  --border-hover:  rgba(15, 52, 80, 0.3);
  --text-primary:  #0b2d42;
  --text-secondary:#1a5470;
  --text-muted:    #4a7a8a;
  --shadow:        0 2px 16px rgba(15, 52, 80, 0.12);
  --shadow-hover:  0 6px 28px rgba(15, 52, 80, 0.22);
  --wave-1:        rgba(15, 52, 80, 0.07);
  --wave-2:        rgba(22, 72, 108, 0.05);
  --search-bg:     rgba(255,255,255,0.55);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

/* ── Animated Background ──────────────────────────────── */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

[data-theme="dark"] .bg-layer {
  background: linear-gradient(
    160deg,
    #05141e 0%,
    #0a2133 35%,
    #0f3450 65%,
    #0a2539 100%
  );
}
[data-theme="light"] .bg-layer {
  background: linear-gradient(
    160deg,
    #c8e4ef 0%,
    #d8eef7 40%,
    #e8f4f9 100%
  );
}

/* Ripple grid - subtle dot pattern */
.ripple-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(91,184,212,0.08) 1px, transparent 1px);
  background-size: 32px 32px;
}
[data-theme="light"] .ripple-grid {
  background-image: radial-gradient(circle, rgba(15,52,80,0.06) 1px, transparent 1px);
}

/* Animated waves */
@keyframes waveFlow {
  0%   { transform: translateX(0) scaleY(1); }
  50%  { transform: translateX(-3%) scaleY(1.04); }
  100% { transform: translateX(0) scaleY(1); }
}

.wave {
  position: absolute;
  left: -5%;
  width: 110%;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  animation: waveFlow ease-in-out infinite;
}

[data-theme="dark"] .wave-1 {
  bottom: 0;
  height: 180px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 180'%3E%3Cpath fill='rgba(15,52,80,0.5)' d='M0,80 C240,140 480,20 720,80 C960,140 1200,20 1440,80 L1440,180 L0,180 Z'/%3E%3C/svg%3E");
  animation-duration: 9s;
}
[data-theme="dark"] .wave-2 {
  bottom: 0;
  height: 140px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 140'%3E%3Cpath fill='rgba(8,32,47,0.6)' d='M0,60 C360,120 720,0 1080,60 C1260,90 1380,40 1440,60 L1440,140 L0,140 Z'/%3E%3C/svg%3E");
  animation-duration: 12s;
  animation-delay: -3s;
}
[data-theme="dark"] .wave-3 {
  bottom: 0;
  height: 100px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100'%3E%3Cpath fill='rgba(5,20,30,0.8)' d='M0,40 C480,80 960,0 1440,40 L1440,100 L0,100 Z'/%3E%3C/svg%3E");
  animation-duration: 15s;
  animation-delay: -6s;
}

[data-theme="light"] .wave-1 {
  bottom: 0;
  height: 180px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 180'%3E%3Cpath fill='rgba(15,52,80,0.06)' d='M0,80 C240,140 480,20 720,80 C960,140 1200,20 1440,80 L1440,180 L0,180 Z'/%3E%3C/svg%3E");
  animation-duration: 9s;
}
[data-theme="light"] .wave-2 {
  bottom: 0;
  height: 140px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 140'%3E%3Cpath fill='rgba(22,72,108,0.05)' d='M0,60 C360,120 720,0 1080,60 C1260,90 1380,40 1440,60 L1440,140 L0,140 Z'/%3E%3C/svg%3E");
  animation-duration: 12s;
  animation-delay: -3s;
}
[data-theme="light"] .wave-3 { display: none; }

/* ── Header ───────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px 0;
  animation: slideDown 0.5s ease both;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Logo */
.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
}
.logo-link:hover .logo-icon { transform: translateY(-2px); }

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(232, 164, 48, 0.15);
  border: 1.5px solid rgba(232, 164, 48, 0.35);
  border-radius: 10px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--brand-accent);
  transition: transform 0.3s ease;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.logo-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}
.logo-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Right side: clock + theme toggle */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.clock {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 300;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.04em;
  min-width: 64px;
  text-align: right;
}

.theme-toggle {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.85);
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: rgba(255,255,255,0.2);
  transform: rotate(20deg);
}
.theme-toggle svg { width: 16px; height: 16px; }
.icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* Search bar */
.search-bar-wrapper {
  max-width: 1100px;
  margin: 10px auto 0;
  padding-bottom: 12px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--search-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.search-bar:focus-within {
  border-color: var(--brand-accent2);
  background: rgba(91,184,212,0.08);
  box-shadow: 0 0 0 3px rgba(91,184,212,0.12);
}

.search-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

#searchInput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text-primary);
}
#searchInput::placeholder { color: var(--text-muted); }

.search-hint {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(0,0,0,0.15);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  opacity: 0.7;
}
[data-theme="light"] .search-hint { background: rgba(0,0,0,0.06); }

/* ── Main content ─────────────────────────────────────── */
.content {
  flex: 1;
  position: relative;
  z-index: 1;
  padding: 32px 24px 80px;
}

.categories {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* ── Category Section ─────────────────────────────────── */
.category {
  animation: fadeUp 0.45s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.category-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-accent);
}

.category-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border) 0%, transparent 100%);
}

.category-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 300;
}

/* ── Link Grid ────────────────────────────────────────── */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

/* ── Link Card ────────────────────────────────────────── */
.link-card {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text-primary);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    transform 0.22s ease,
    box-shadow 0.22s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(91,184,212,0.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.22s;
}

.link-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.link-card:hover::before { opacity: 1; }

.link-card:active { transform: translateY(-1px); }

/* Favicon */
.favicon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
[data-theme="light"] .favicon-wrap {
  background: rgba(15,52,80,0.06);
}

.favicon-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.favicon-fallback {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-accent2);
}

.link-info { min-width: 0; }

.link-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.link-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  font-weight: 300;
}

/* External link arrow */
.link-arrow {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}
.link-card:hover .link-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}
.link-arrow svg { width: 13px; height: 13px; }

/* Hidden card during search */
.link-card.hidden { display: none; }

/* ── Empty state ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state p { font-size: 0.95rem; }
.empty-state span { color: var(--brand-accent2); }
.hidden { display: none !important; }

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.1);
  flex-wrap: wrap;
}
[data-theme="light"] .site-footer { background: rgba(15,52,80,0.04); }

.site-footer a {
  color: var(--brand-accent2);
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }
.footer-sep { opacity: 0.35; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
  .site-header { padding: 10px 16px 0; }
  .content { padding: 20px 16px 60px; }
  .link-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .clock { display: none; }
  .logo-sub { display: none; }
  .search-hint { display: none; }
}

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

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--brand-mid);
  border-radius: 3px;
}

/* ── Focus styles ─────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--brand-accent2);
  outline-offset: 2px;
  border-radius: 4px;
}
