/* =========================================================
   AIDicted Web — Full Design System
   Dark neon aesthetic matching the Android app exactly
   ========================================================= */

:root {
  --cyan: #00e5ff;
  --purple: #b540f5;
  --pink: #ff40a0;
  --bg: #080810;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(12, 12, 28, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 229, 255, 0.3);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.5);
  --text-dim: rgba(255, 255, 255, 0.3);
  --nav-h: 72px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(0, 229, 255, 0.15);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

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

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

ul {
  list-style: none;
}

input,
button {
  outline: none;
}

/* ---- Ambient Background ---- */
.bg-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.18;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--cyan), transparent 70%);
  top: -10%;
  left: -10%;
  animation: driftA 18s ease-in-out infinite alternate;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--purple), transparent 70%);
  bottom: -5%;
  right: -5%;
  animation: driftB 22s ease-in-out infinite alternate;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--pink), transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: driftA 28s ease-in-out infinite alternate-reverse;
  opacity: 0.08;
}

@keyframes driftA {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(60px, 40px) scale(1.1);
  }
}

@keyframes driftB {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(-50px, -30px) scale(1.08);
  }
}

/* ---- Typography ---- */
h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

p {
  color: var(--text-muted);
}

.gradient-text {
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #000;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 229, 255, 0.5);
}

.btn-save {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.92rem;
}

.btn-save:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-save.saved {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-full {
  width: 100%;
  justify-content: center;
  margin-top: 24px;
}

/* ---- Navbar ---- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.navbar.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  cursor: pointer;
}

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

.logo-dot {
  color: var(--purple);
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-card);
}

.nav-link.active {
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.1);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

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

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Section System ---- */
.section {
  display: none;
  padding-top: calc(var(--nav-h) + 16px);
  min-height: 100vh;
  padding-bottom: 64px;
}

.section.active {
  display: block;
}

/* ---- Top Progress Bar ---- */
.top-progress {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  height: 2px;
  z-index: 999;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--pink));
  width: 0%;
  transition: width 0.3s ease;
}

/* ===== HERO ===== */
.hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 48px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 50px;
  background: rgba(0, 229, 255, 0.1);
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 1px solid rgba(0, 229, 255, 0.2);
  margin-bottom: 20px;
}

.badge.pulse::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff3b3b;
  display: inline-block;
  animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.2;
  }
}

.hero-sub {
  font-size: 1.05rem;
  margin-top: 12px;
  max-width: 520px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 32px;
}

.stat {
  text-align: center;
}

.stat span {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  color: var(--cyan);
}

.stat small {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

.source-bubbles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 280px;
}

.source-pill {
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

.source-pill.tc {
  color: #2da44e;
  border-color: rgba(45, 164, 78, 0.3);
  background: rgba(45, 164, 78, 0.06);
}

.source-pill.verge {
  color: #fa4a4a;
  border-color: rgba(250, 74, 74, 0.3);
  background: rgba(250, 74, 74, 0.06);
}

.source-pill.wired {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.source-pill.mit {
  color: #b40001;
  border-color: rgba(180, 0, 1, 0.3);
  background: rgba(180, 0, 1, 0.06);
}

.source-pill.ars {
  color: #f5a500;
  border-color: rgba(245, 165, 0, 0.3);
  background: rgba(245, 165, 0, 0.06);
}

.source-pill.vb {
  color: #00aaff;
  border-color: rgba(0, 170, 255, 0.3);
  background: rgba(0, 170, 255, 0.06);
}

/* ===== FILTER BAR ===== */
.filter-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.filter-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.chip:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

.chip.active {
  background: rgba(0, 229, 255, 0.12);
  color: var(--cyan);
  border-color: rgba(0, 229, 255, 0.4);
}

.refresh-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
}

.refresh-btn:hover {
  color: var(--cyan);
  border-color: var(--border-glow);
}

.refresh-btn.spinning svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== LOADER ===== */
.loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 100px 0;
}

.loader-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--cyan);
  animation: spin 0.9s linear infinite;
}

.loader-text {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ===== ERROR ===== */
.error-wrap {
  text-align: center;
  padding: 80px 0;
}

.error-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
}

.error-wrap h3 {
  margin-bottom: 8px;
}

.error-wrap p {
  margin-bottom: 24px;
}

/* ===== NEWS GRID ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  padding: 32px 0;
}

/* ===== NEWS CARD ===== */
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-card);
}

.card-img-wrap {
  position: relative;
  height: 200px;
  overflow: hidden;
  flex-shrink: 0;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.news-card:hover .card-img {
  transform: scale(1.04);
}

.card-img-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(8, 8, 16, 0.8));
}

.card-source-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 3px 10px;
  border-radius: 50px;
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: var(--cyan);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-body {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-time {
  font-size: 0.76rem;
  color: var(--text-dim);
}

.card-save-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.card-save-btn:hover {
  background: rgba(0, 229, 255, 0.1);
  border-color: var(--border-glow);
}

.card-save-btn.saved {
  color: var(--cyan);
  border-color: var(--border-glow);
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-summary {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-read-more {
  margin-top: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ===== ARTICLE MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.article-modal {
  position: fixed;
  z-index: 2001;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 30px));
  width: min(640px, calc(100vw - 32px));
  max-height: 90vh;
  overflow-y: auto;
  background: #0d0d1a;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.article-modal.open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.modal-image-wrap {
  position: relative;
  height: 260px;
  overflow: hidden;
}

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-image-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, #0d0d1a);
}

.modal-body {
  padding: 24px 28px 28px;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-source {
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(0, 229, 255, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.modal-time {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin-bottom: 16px;
}

.modal-summary {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== SEARCH ===== */
.section-header-block {
  text-align: center;
  padding: 40px 0 32px;
}

.section-header-block p {
  margin-top: 8px;
  font-size: 1rem;
}

.search-box {
  position: relative;
  max-width: 640px;
  margin: 0 auto 16px;
}

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

.search-input {
  width: 100%;
  padding: 16px 48px 16px 52px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

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

.search-input:focus {
  border-color: var(--border-glow);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}

.search-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 4px;
}

.search-clear:hover {
  color: var(--text);
}

.results-count {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

/* ===== EMPTY STATES ===== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-state span {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
}

.empty-state h3 {
  margin-bottom: 8px;
}

/* ===== CONTACT ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 700px;
  margin: 0 auto 32px;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  transition: var(--transition);
  display: block;
}

.contact-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-3px);
}

.contact-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.contact-card h3 {
  margin-bottom: 8px;
}

.contact-card span {
  color: var(--cyan);
  font-weight: 600;
  font-size: 0.95rem;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 700px;
  margin: 0 auto;
}

.about-card h3 {
  margin-bottom: 12px;
}

.about-card p {
  font-size: 0.95rem;
  line-height: 1.7;
}

.about-stats {
  display: flex;
  gap: 24px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.about-stat {
  text-align: center;
  flex: 1;
}

.about-stat strong {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  color: var(--cyan);
}

.about-stat span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a2e;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 3000;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand p {
  font-size: 0.85rem;
  margin-top: 6px;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: var(--transition);
}

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

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* ===== RESPONSIVE ===== */
@media (max-width:768px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-sources {
    display: none;
  }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    display: none;
  }

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

  .nav-link {
    border-radius: var(--radius-sm);
  }

  .filter-chips {
    padding-right: 56px;
  }

  .hero-stats {
    flex-wrap: wrap;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-body {
    padding: 20px;
  }
}

@media (max-width:480px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 40px 0 32px;
  }

  h1 {
    font-size: 1.9rem;
  }
}