:root {
  --primary: #6366f1;
  --secondary: #ec4899;
  --bg-dark: #0f172a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --card-hover: rgba(255, 255, 255, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Outfit", sans-serif;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.background-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  filter: blur(100px);
  border-radius: 50%;
  opacity: 0.5;
  animation: float 15s infinite alternate ease-in-out;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  max-width: 600px;
  max-height: 600px;
  background: var(--primary);
}

.blob-2 {
  bottom: -10%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  max-width: 700px;
  max-height: 700px;
  background: var(--secondary);
  animation-delay: -5s;
}

.blob-3 {
  top: 30%;
  left: 30%;
  width: 40vw;
  height: 40vw;
  max-width: 500px;
  max-height: 500px;
  background: #8b5cf6;
  animation-duration: 20s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(60px, 60px) scale(1.1);
  }
}

/* Navigation */
.navbar {
  width: 100%;
  max-width: 1300px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo span {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.nav-links a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: color 0.3s ease;
}

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

.auth-buttons {
  display: flex;
  gap: 15px;
}

.login-btn,
.signup-btn {
  padding: 8px 24px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.login-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-main);
}

.login-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.signup-btn {
  background: linear-gradient(135deg, #10b981, #34d399);
  border: none;
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.signup-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* Hero Section Split Layout */
.hero-section {
  width: 90%;
  max-width: 1300px;
  margin: 80px auto;
  display: flex;
  align-items: center;
  gap: 60px;
  min-height: 65vh;
}

.hero-content {
  flex: 1;
}

.badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-content h1 {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}

.hero-content h1 span {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 90%;
}

.hero-stats {
  display: flex;
  gap: 40px;
}

.stat-num {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Scanner Container (Right Side) */
.scanner-container {
  flex: 1;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px;
  box-shadow:
    0 30px 60px -15px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(99, 102, 241, 0.15);
  position: relative;
  overflow: hidden;
}

.scanner-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.scanner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 16px;
}

.scanner-header h3 {
  font-size: 1.2rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.pulse-indicator {
  width: 12px;
  height: 12px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.upload-section {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 60px 20px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
}

.upload-section:hover,
.upload-section.dragover {
  border-color: var(--secondary);
  background: rgba(236, 72, 153, 0.05);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(236, 72, 153, 0.1);
}

.upload-content .icon {
  margin-bottom: 20px;
  animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.upload-content h3 {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  margin-bottom: 10px;
}

.action-btn {
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.camera-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
}

.camera-btn:hover {
  box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.camera-content {
  max-width: 600px;
}

.browse-btn {
  color: var(--secondary);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

.upload-content small {
  display: block;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

.auth-promo {
  margin-bottom: 20px;
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.5;
}

.auth-message {
  min-height: 24px;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.small-text {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.small-text span {
  color: var(--secondary);
  cursor: pointer;
}

/* Info Sections */
.info-section {
  width: 90%;
  max-width: 1300px;
  margin-bottom: 80px;
  padding: 50px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  backdrop-filter: blur(10px);
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-header h2 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.section-header h2 span {
  color: var(--secondary);
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.2rem;
}

/* Steps Grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.step-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 40px 30px;
  text-align: center;
  transition:
    transform 0.3s ease,
    background 0.3s ease;
  position: relative;
  overflow: hidden;
}

.step-card:hover {
  transform: translateY(-10px);
  background: var(--card-hover);
}

.step-number {
  font-size: 4rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.05);
  position: absolute;
  top: -10px;
  left: 20px;
  z-index: 0;
}

.step-card h3 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.step-card p {
  color: var(--text-muted);
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 30px;
  transition: all 0.3s ease;
}

.feature-card:hover {
  background: var(--card-hover);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.1);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Preview Section Styling */
.preview-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.media-container {
  width: 100%;
  max-width: 500px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  background: rgba(0, 0, 0, 0.5);
}

.media-container img,
.media-container video {
  width: 100%;
  max-height: 400px;
  display: block;
  object-fit: contain;
}

.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--secondary);
  box-shadow:
    0 0 15px var(--secondary),
    0 0 30px var(--secondary);
  animation: scan 2s linear infinite;
  display: none;
  z-index: 10;
}

.analysis-status {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--primary);
  font-weight: 600;
  font-size: 1.1rem;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(99, 102, 241, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.results {
  width: 100%;
  animation: fadeIn 0.6s ease;
}

.result-card {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  margin-bottom: 24px;
  border: 1px solid var(--glass-border);
}

.result-card h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.confidence-bar {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 12px;
}

.confidence-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.confidence-text {
  color: var(--text-muted);
  font-size: 1rem;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 30px;
}

.detail-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
}

.detail-item span {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.detail-item strong {
  font-size: 1rem;
  color: var(--text-main);
  word-break: break-word;
}

.reset-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.reset-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
}

.verdict-real {
  color: #34d399;
  text-shadow: 0 0 20px rgba(52, 211, 153, 0.5);
}
.verdict-ai {
  color: #fbbf24;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-dark);
  width: 90%;
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 24px;
  padding: 40px;
  position: relative;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

/* Custom Scrollbar for Modal */
.modal-content::-webkit-scrollbar {
  width: 6px;
}
.modal-content::-webkit-scrollbar-track {
  background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
}

.back-btn {
  position: absolute;
  top: 24px;
  left: 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.3s ease;
}

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

.modal-content h2 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.modal-content p {
  color: var(--text-muted);
  margin-bottom: 30px;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.input-group input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
  outline: none;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.signup-mode .input-group input:focus {
    border-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.signup-mode-title {
    background: linear-gradient(135deg, #10b981, #34d399) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.signup-mode .input-group label {
    color: #a7f3d0;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

.modal-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
}

.modal-footer span {
  color: var(--secondary);
  cursor: pointer;
  font-weight: 600;
}

footer {
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--glass-border);
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  margin-top: 20px;
}

@media (max-width: 900px) {
  .hero-section {
    flex-direction: column;
    text-align: center;
  }
  .hero-stats {
    justify-content: center;
  }
  .scanner-container {
    width: 100%;
  }
}
