/* ============================================
   Global Data Ocean — style.css
   ============================================ */

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

:root {
  --bg-primary: #0a1628;
  --bg-secondary: #0f2035;
  --bg-card: rgba(16, 42, 67, 0.9);
  --bg-card-hover: rgba(20, 55, 90, 0.95);
  --accent: #00b4d8;
  --accent-glow: rgba(0, 180, 216, 0.4);
  --accent-dim: rgba(0, 180, 216, 0.15);
  --text-primary: #f0f4f8;
  --text-secondary: #8ba3c0;
  --text-muted: #5a7a9a;
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(0, 180, 216, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s ease;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Space Grotesk', 'Inter', system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: #48cae4;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  padding: 80px 20px 100px;
  text-align: center;
  background: linear-gradient(180deg, #061020 0%, var(--bg-primary) 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  opacity: 0.3;
  pointer-events: none;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  position: relative;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero .tagline {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 40px;
  position: relative;
}

/* Wave SVG */
.hero-wave {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  line-height: 0;
}

.hero-wave svg {
  display: block;
  width: 100%;
  height: 60px;
}

/* --- Search Bar --- */
.search-container {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  z-index: 1;
}

.search-container input {
  width: 100%;
  padding: 16px 20px 16px 50px;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.search-container input::placeholder {
  color: var(--text-muted);
}

.search-container input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow), 0 0 60px rgba(0, 180, 216, 0.1);
}

.search-container .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 180, 216, 0.1); }
  50% { box-shadow: 0 0 20px rgba(0, 180, 216, 0.25); }
}

.search-container input:not(:focus) {
  animation: pulse-glow 3s ease-in-out infinite;
}

/* --- Filters Section --- */
.filters-section {
  padding: 30px 20px 10px;
  max-width: 1400px;
  margin: 0 auto;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}

.category-pill {
  padding: 8px 18px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.category-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.category-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.results-count {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 8px;
}

/* --- Main Layout with Sidebar --- */
.main-layout {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  gap: 30px;
}

@media (min-width: 1201px) {
  .main-layout {
    grid-template-columns: 1fr 300px;
  }
}

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

/* --- Source Card --- */
.source-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), opacity var(--transition);
  opacity: 1;
  transform: translateY(0);
}

.source-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 180, 216, 0.08);
  background: var(--bg-card-hover);
}

.source-card.hidden {
  display: none;
}

.source-card.fade-out {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.card-emoji {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}

.card-title a {
  color: var(--text-primary);
}

.card-title a:hover {
  color: var(--accent);
}

.card-org {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 14px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  font-family: var(--font-body);
}

.tag:hover {
  background: rgba(0, 180, 216, 0.3);
}

.card-category-label {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* --- Sidebar --- */
.sidebar {
  display: none;
}

@media (min-width: 1201px) {
  .sidebar {
    display: block;
    position: sticky;
    top: 20px;
    align-self: start;
  }
}

/* --- Footer --- */
.site-footer {
  margin-top: 60px;
  padding: 40px 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 2fr 1fr;
  }
}

.footer-about h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.footer-about p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

.footer-bottom {
  max-width: 1400px;
  margin: 20px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition);
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 180, 216, 0.3);
}

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

.back-to-top:hover {
  background: #48cae4;
  transform: translateY(-2px);
}

/* --- Ad Slots --- */
.ad-slot {
  text-align: center;
  margin: 20px auto;
  max-width: 100%;
  overflow: hidden;
}

.ad-slot .ad-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  opacity: 0.6;
}

.ad-slot--leaderboard {
  max-width: 728px;
  padding: 10px 0;
}

.ad-slot--leaderboard ins {
  display: inline-block;
  width: 728px;
  height: 90px;
}

.ad-slot--in-feed {
  grid-column: 1 / -1;
  padding: 10px 0;
}

.ad-slot--in-feed ins {
  display: block;
  width: 100%;
  height: auto;
}

.ad-slot--sidebar ins {
  display: inline-block;
  width: 300px;
  height: 250px;
}

.ad-slot--footer {
  max-width: 728px;
  padding: 10px 0;
}

.ad-slot--footer ins {
  display: inline-block;
  width: 728px;
  height: 90px;
}

/* Responsive ad behavior */
@media (max-width: 767px) {
  .ad-slot--leaderboard ins {
    width: 320px;
    height: 50px;
  }
  .ad-slot--footer ins {
    width: 320px;
    height: 50px;
  }
}

@media (max-width: 1200px) {
  .ad-slot--sidebar {
    display: none;
  }
}

/* --- Nav --- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 14px 20px;
  background: rgba(10, 22, 40, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition);
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-logo .accent {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.nav-links a:hover {
  color: var(--accent);
}

@media (max-width: 600px) {
  .nav-links {
    gap: 14px;
  }
  .nav-links a {
    font-size: 0.8rem;
  }
}

/* Push content below fixed nav */
.hero {
  padding-top: 120px;
}

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
