:root {
  --primary: #00d4ff;
  --dark-bg: #0a0e1a;
  --light-bg: #f8fbff;
  --card-dark: rgba(255,255,255,0.09);
  --card-light: rgba(255,255,255,0.95);
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--dark-bg);
  color: #fff;
  min-height: 100vh;
  transition: all 0.5s ease;
  display: flex;
  flex-direction: column;
}

body.light {
  background: var(--light-bg);
  color: #1a1a2e;
}


/* Navigation (Flexbox) */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(10,14,26,0.94);
  backdrop-filter: blur(20px);
  z-index: 1000;
  padding: 18px 0;
  border-bottom: 1px solid rgba(0,212,255,0.2);
}

body.light nav {
  background: rgba(255,255,255,0.95);
  border-bottom: 1px solid #e0e0e0;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.logo {
  font-size: 2.3rem;
  font-weight: 700;
  color: white;
}

body.light .logo { color: #1a1a2e; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger span {
  width: 28px;
  height: 3px;
  background: white;
  border-radius: 3px;
  transition: 0.4s;
}

body.light .hamburger span { background: #333; }

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(8px,8px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(7px,-7px); }

.search-box {
  position: relative;
  flex: 1;
  max-width: 500px;
  margin: 0 30px;
}

#searchInput {
  width: 100%;
  padding: 14px 55px 14px 24px;
  border: none;
  border-radius: 50px;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 1.05rem;
  outline: none;
}

body.light #searchInput {
  background: rgba(0,122,255,0.1);
  color: #333;
  border: 1px solid #cce5ff;
}

.search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 30px;
  transition: 0.3s;
  cursor: pointer;
}

body.light .nav-links a { color: #333; }

.nav-links a:hover,
.nav-links a.active {
  background: rgba(0,212,255,0.25);
  color: var(--primary);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.account-btn {
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  transition: 0.4s;
}

.account-btn:hover {
  background: var(--primary);
  color: black;
}

.user-name {
  color: var(--primary);
  font-weight: 600;
  font-size: 1.1rem;
  display: none;
}

/* Icon theme toggle button */
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: var(--primary);
  border: 1px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.3s ease;
}
.icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 6px rgba(0,212,255,0.15);
}
body.light .icon-btn {
  background: rgba(0,212,255,0.12);
  border-color: rgba(0,212,255,0.35);
  color: #007a99;
}

/* Mobile menu */
@media (max-width: 968px) {
  .hamburger { display: flex; }
  .nav-links, .search-box { display: none; }

  .mobile-menu {
    position: fixed;
    top: 80px; left: 0; right: 0;
    background: rgba(10,14,26,0.98);
    padding: 30px 0;
    text-align: center;
    transform: translateY(-100%);
    transition: 0.4s;
    z-index: 999;
  }

  body.light .mobile-menu { background: white; }

  .mobile-menu.active { transform: translateY(0); }

  .mobile-menu a {
    display: block;
    padding: 18px;
    color: white;
    font-size: 1.4rem;
    text-decoration: none;
  }

  body.light .mobile-menu a { color: #333; }
}

/* Add button */
.add-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 160px;
  height: 60px;
  background: var(--primary);
  color: black;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,212,255,0.5);
  z-index: 999;
  transition: 0.3s;
}

.add-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,212,255,0.6);
}

@media (max-width: 480px) {
  .add-btn {
    width: calc(100% - 40px);
    left: 20px;
    right: auto;
    font-size: 1rem;
  }
}

/* Main sections */
.section {
  display: none;
  padding: 120px 20px 100px;
  min-height: 100vh;
}

.section.active { display: block; }

/* Smooth page section transition */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.section.active { animation: fadeInUp 0.35s ease-out; }
body.light .section.active { animation: fadeInUp 0.35s ease-out; }

/* Hero */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
  max-width: 1000px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 4.5rem;
  margin-bottom: 20px;
  background: linear-gradient(90deg, #00d4ff, #7cf9ff, #ffffff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 6px 30px rgba(0,212,255,0.25);
}

body.light .hero h1 { color: rgb(42, 203, 232)}

.hero p {
  font-size: 1.4rem;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto 40px;
  opacity: 0.9;
}

.cta-buttons {
  display: flex;
  gap: 25px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 80px;
}

.btn {
  padding: 18px 45px;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  transition: 0.4s;
  min-width: 220px;
  text-align: center;
  cursor: pointer;
}

.btn-primary { background: var(--primary); color: black; }
.btn-outline { border: 2px solid var(--primary); color: var(--primary); background: transparent; }

.btn:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0,212,255,0.4);
}

/* Features - Grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
}

.feature-card {
  background: var(--card-dark);
  border-radius: 24px;
  padding: 40px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  transition: 0.4s;
}

body.light .feature-card {
  background: var(--card-light);
  border: 1px solid #e0e0e0;
}

.feature-card:hover { transform: translateY(-10px); }

.feature-card i {
  font-size: 3.5rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.6rem;
  margin-bottom: 15px;
  color: white;
}

body.light .feature-card h3 { color: #1a1a2e; }

/* Stats - Grid */
.stats-container {
  text-align: center;
  padding: 100px 20px;
  background: rgba(255,255,255,0.05);
}

body.light .stats-container { background: rgba(0,122,255,0.05); }

.stats-container h2 {
  font-size: 2.8rem;
  margin-bottom: 60px;
  color: white;
}

body.light .stats-container h2 { color: #1a1a2e; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.stat-card {
  background: var(--card-dark);
  border-radius: 24px;
  padding: 50px 30px;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  transition: 0.4s;
}

body.light .stat-card {
  background: var(--card-light);
  border: 1px solid #e0e0e0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.stat-card:hover { transform: translateY(-15px); }

.stat-card i {
  font-size: 4rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.stat-card h3 {
  font-size: 3.5rem;
  margin: 15px 0;
  color: var(--primary);
}

.stat-card p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Closing section */
.closing-section {
  text-align: center;
  padding: 120px 20px;
  max-width: 900px;
  margin: 0 auto;
}

.closing-section h2 {
  font-size: 3rem;
  margin-bottom: 30px;
  color: white;
}

body.light .closing-section h2 { color: #1a1a2e; }

.closing-section p {
  font-size: 1.4rem;
  line-height: 1.8;
  margin-bottom: 20px;
  opacity: 0.9;
}

.closing-section .cta-buttons {
  margin-top: 50px;
}

/* Cards grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
}

.card {
  background: var(--card-dark);
  border-radius: 24px;
  padding: 35px;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  transition: 0.4s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

body.light .card {
  background: var(--card-light);
  border: 1px solid #e0e0e0;
  box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.card:hover { transform: translateY(-12px); }

.card h3 {
  color: var(--primary);
  font-size: 1.8rem;
  margin-bottom: 15px;
}
.card .btn { margin-top: auto !important; width: 100%; }

.section h2 {
  text-align: center;
  font-size: 3.8rem;
  margin: 40px 0;
  color: white;
}

body.light .section h2 { color: #1a1a2e; }

/* Topic filter buttons */
.filter-bar {
  text-align: center;
  margin: 30px 0 50px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.topic-btn {
  padding: 10px 20px;
  border-radius: 50px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  cursor: pointer;
  font-size: 1rem;
  transition: 0.3s;
}

body.light .topic-btn {
  background: rgba(0,212,255,0.1);
  border: 1px solid rgba(0,212,255,0.3);
  color: #333;
}

.topic-btn.active,
.topic-btn:hover {
  background: var(--primary);
  color: black;
  border-color: var(--primary);
}

/* Stronger selected state in light mode */
body.light .topic-btn.active {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(0,212,255,0.35);
}

/* Accessible focus highlighting */
.topic-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,212,255,0.25);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,14,26,0.85);
  backdrop-filter: blur(12px);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
}

body.light .modal { background: rgba(255,255,255,0.92); }

.modal.active { display: flex; }

.modal-content {
  background: #0f1422;
  padding: 40px;
  border-radius: 24px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,212,255,0.3);
}

body.light .modal-content { background: white; color: #333; }

.close-modal {
  position: absolute;
  top: 20px; right: 25px;
  font-size: 32px;
  cursor: pointer;
  color: #888;
}

.close-modal:hover { color: var(--primary); }

.modal h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: white;
}

body.light .modal h2 { color: #1a1a2e; }

.modal input, .modal textarea {
  width: 100%;
  padding: 14px;
  margin: 10px 0;
  border-radius: 12px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 1rem;
}

body.light .modal input,
body.light .modal textarea {
  background: #f0f8ff;
  color: #333;
  border: 1px solid #cce5ff;
}

.modal textarea { height: 120px; resize: vertical; }
.modal select {
  width: 100%;
  padding: 14px;
  margin: 10px 0;
  border-radius: 12px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 1rem;
}
body.light .modal select {
  background: #f0f8ff;
  color: #333;
  border: 1px solid #cce5ff;
}

/* Auth form submit button styling */
.modal #authForm button {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: black;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 10px;
}
.modal #authForm button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0,212,255,0.35);
}
.modal #authForm button:active {
  transform: translateY(0);
  box-shadow: none;
}

.social-links {
  margin: 25px 0;
  padding: 20px;
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
}

body.light .social-links { background: rgba(0,122,255,0.05); }

.social-links h3 {
  font-size: 1.4rem;
  margin-bottom: 15px;
  color: var(--primary);
}

.social-links a {
  display: block;
  margin: 10px 0;
  color: var(--primary);
  text-decoration: none;
  font-size: 1.1rem;
}

.social-links a:hover { text-decoration: underline; }

/* Footer */
footer {
  margin-top: auto;
  padding: 40px 20px;
  background: rgba(0,0,0,0.3);
  text-align: center;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

body.light footer {
  background: rgba(0,0,0,0.05);
  border-top: 1px solid #e0e0e0;
}

footer a {
  color: var(--primary);
  text-decoration: none;
  margin: 0 15px;
}

footer a:hover { text-decoration: underline; }
