/* ================== VARIABLES ================== */
:root {
  /* Light theme colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f0f1f3;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --border-color: #e5e7eb;
  --accent: #3b82f6;
  --accent-light: #06b6d4;
  --nav-bg: rgba(255, 255, 255, 0.9);
  --modal-bg: #ffffff;
  --feature-bg: rgba(248, 249, 250, 0.8);
  --feature-border: #e5e7eb;
}

[data-theme="dark"] {
  /* Dark theme colors */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #111827;
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-light: #cbd5e1;
  --border-color: rgba(255, 255, 255, 0.1);
  --accent: #3b82f6;
  --accent-light: #06b6d4;
  --nav-bg: rgba(15, 23, 42, 0.8);
  --modal-bg: #111827;
  --feature-bg: rgba(30, 41, 59, 0.5);
  --feature-border: rgba(255, 255, 255, 0.1);
}

/* ================== RESET & BASE STYLES ================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Apply gradient background for dark theme only */
[data-theme="dark"] body {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f4c75 100%);
}

/* ================== NAVIGATION ================== */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 5%;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease;
}

.nav-logo {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s ease;
}

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

/* ================== BUTTONS ================== */
.btn {
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: white;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: var(--feature-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.nav-login-btn {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: white;
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.nav-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.theme-toggle-btn {
  background: none;
  padding: 8px 12px;
  font-size: 20px;
  box-shadow: none;
  transition: transform 0.3s ease;
}

.theme-toggle-btn:hover {
  transform: scale(1.2);
}

/* ================== HERO SECTION ================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 5%;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent);
  border-radius: 50%;
  top: -100px;
  right: -100px;
  z-index: 0;
}

.hero::after {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.1), transparent);
  border-radius: 50%;
  bottom: -50px;
  left: -50px;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 800px;
  animation: fadeInUp 0.8s ease-out;
}

.badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(6, 182, 212, 0.2));
  color: #06b6d4;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 50px;
  margin-bottom: 30px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid rgba(6, 182, 212, 0.3);
  backdrop-filter: blur(10px);
}

h1 {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 25px;
  letter-spacing: -1px;
  color: var(--text-primary);
  word-spacing: 0.05em;
}

.hero p {
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1.8;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

/* ================== FEATURES SECTION ================== */
.features {
  padding: 80px 5%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  background: var(--feature-bg);
  backdrop-filter: blur(10px);
  padding: 40px;
  border-radius: 12px;
  border: 1px solid var(--feature-border);
  transition: all 0.3s ease;
  text-align: center;
  animation: fadeInUp 0.8s ease-out;
}

.feature-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: var(--bg-tertiary);
  transform: translateY(-5px);
}

.feature-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
}

.feature-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

/* ================== CTA SECTION ================== */
.cta-section {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(6, 182, 212, 0.15));
  padding: 80px 5%;
  text-align: center;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.cta-section h2 {
  font-size: 40px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.cta-section p {
  color: var(--text-secondary);
  font-size: 18px;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ================== FOOTER ================== */
.footer {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  text-align: center;
  padding: 40px 5%;
  font-size: 14px;
  border-top: 1px solid var(--border-color);
  transition: background-color 0.3s ease;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
  text-align: left;
}

.footer-section h4 {
  color: var(--text-primary);
  font-size: 16px;
  margin-bottom: 15px;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 30px;
  text-align: center;
}

/* ================== MODAL ================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex !important;
  animation: slideIn 0.3s ease-out;
}

.modal-content {
  background: var(--modal-bg);
  padding: 40px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  border: 1px solid var(--border-color);
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease;
}

.modal-content h2 {
  color: var(--text-primary);
  font-size: 24px;
  margin-bottom: 10px;
}

.modal-content p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 25px;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  color: var(--text-light);
  cursor: pointer;
  transition: color 0.3s ease;
  background: none;
  border: none;
  padding: 0;
}

.close-btn:hover {
  color: var(--text-primary);
}

/* ================== AUTH FORM ================== */
#authForm {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#authForm input {
  padding: 12px 15px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

#authForm input::placeholder {
  color: var(--text-light);
}

#authForm input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auth-error {
  color: #ef4444;
  font-size: 13px;
  display: none;
  padding: 10px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 6px;
  margin: 10px 0;
}

.auth-error.show {
  display: block;
}

#submitAuthBtn {
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

#submitAuthBtn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

#submitAuthBtn:active:not(:disabled) {
  transform: translateY(0);
}

#submitAuthBtn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ================== ANIMATIONS ================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ================== RESPONSIVE DESIGN ================== */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .nav-links {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    text-align: center;
  }

  .nav-login-btn,
  .theme-toggle-btn {
    width: 100%;
  }

  h1 {
    font-size: 32px;
  }

  .hero p {
    font-size: 16px;
  }

  .cta-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .features {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 40px 5%;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
    padding: 30px;
  }

  .cta-section h2 {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .nav-logo {
    font-size: 18px;
  }

  h1 {
    font-size: 24px;
  }

  .badge {
    font-size: 11px;
    padding: 6px 12px;
  }

  .hero p {
    font-size: 14px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 14px;
  }

  .cta-section {
    padding: 40px 5%;
  }

  .cta-section p {
    font-size: 14px;
  }
}
