@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

:root {
  --bg-dark: #04050a;
  --bg-card: rgba(255, 255, 255, 0.05);
  --accent1: #4be1ec;
  --accent2: #5b42f3;
  --text: #f1f1f1;
  --muted: #a9adc9;
  --white: #ffffff;
}

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Poppins', sans-serif;
  background: radial-gradient(circle at top left, #050714 0%, #010206 100%);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  transition: background 0.6s ease;
}

/* ===== NAVBAR ===== */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  background: rgba(15, 15, 30, 0.4);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  z-index: 1000;
  color: var(--text);
  box-shadow: 0 0 18px rgba(91,66,243,0.25);
  animation: fadeIn 1.2s ease;
}
.nav-left { display: flex; align-items: center; gap: 12px; }
.nav-logo {
  width: 36px; height: 36px;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(91,66,243,0.3);
  animation: logoPulse 4s ease-in-out infinite;
}
@keyframes logoPulse {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(91,66,243,0.2); }
  50% { transform: scale(1.06); box-shadow: 0 0 25px rgba(75,225,236,0.4); }
  100% { transform: scale(1); box-shadow: 0 0 10px rgba(91,66,243,0.2); }
}

.topnav h3 { font-size: 18px; font-weight: 600; color: var(--accent1); }

/* ===== BUTTONS ===== */
.btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: #fff;
  box-shadow: 0 0 12px rgba(91,66,243,0.4);
}
.btn.primary:hover { transform: scale(1.05); box-shadow: 0 0 18px rgba(91,66,243,0.6); }
.btn.outline {
  background: transparent;
  border: 1px solid var(--accent1);
  color: var(--accent1);
}
.btn.outline:hover { background: var(--accent1); color: #000; }
.btn.ghost {
  background: transparent;
  color: var(--muted);
}
.btn.ghost:hover { color: var(--accent1); }

/* ===== LAYOUT ===== */
.app-shell {
  padding-top: 86px;
  padding-bottom: 90px;
  max-width: 980px;
  margin: 0 auto;
}
.screen { padding: 28px; animation: fadeIn 0.8s ease; }

/* ===== USAGE CARD ===== */
.usage-card {
  margin-top: 40px; /* <-- this adds a gap before usage */
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 20px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 12px rgba(91,66,243,0.25);
}

.usage-item {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

progress {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: rgba(255,255,255,0.1);
  appearance: none;
}
progress::-webkit-progress-value {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  border-radius: 5px;
}
progress::-webkit-progress-bar {
  background: rgba(255,255,255,0.1);
  border-radius: 5px;
}


/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, rgba(75,225,236,0.08), rgba(91,66,243,0.06));
  padding: 24px;
  border-radius: 16px;
  text-align: center;
  animation: fadeIn 1s ease;
}
.hero h1 { font-size: 30px; margin-bottom: 10px; color: #fff; }
.lead { color: var(--muted); font-size: 16px; }
.home-actions { margin-top: 20px; display: flex; justify-content: center; gap: 12px; }

/* ===== FEATURES ===== */
.features {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px;
}
.feature-card {
  flex: 1;
  min-width: 200px;
  padding: 16px;
  border-radius: 14px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center;
}
.feature-card:hover {
  box-shadow: 0 0 16px rgba(75,225,236,0.3);
  transform: translateY(-4px);
}

/* ===== TEXTAREA ===== */
textarea {
  width: 100%;
  max-width: 720px;
  height: 140px;
  border-radius: 12px;
  padding: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  resize: vertical;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  background: rgba(15,15,30,0.4);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 50px;
  padding: 8px;
  box-shadow: 0 0 25px rgba(91,66,243,0.25);
  backdrop-filter: blur(14px);
  z-index: 1001;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--text);
  animation: fadeIn 1.2s ease;
}
.bottom-nav .bn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.bottom-nav .bn.active,
.bottom-nav .bn:hover {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: #fff;
  box-shadow: 0 0 12px rgba(75,225,236,0.4);
}

/* ===== GLASS / GLOW ===== */
.glass {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 18px;
}
.glow { box-shadow: 0 0 12px rgba(91,66,243,0.25); }

/* ===== BREATHING GLOW ===== */
.breathing-glow {
  animation: pulseGlow 4s ease-in-out infinite;
}
@keyframes pulseGlow {
  0% { box-shadow: 0 0 12px rgba(91,66,243,0.3); }
  50% { box-shadow: 0 0 25px rgba(75,225,236,0.4); }
  100% { box-shadow: 0 0 12px rgba(91,66,243,0.3); }
}

/* ===== PREMIUM ===== */
.premium-section {
  margin-top: 36px;
  text-align: center;
}
.premium-card-inner {
  background: rgba(255,255,255,0.05);
  padding: 24px;
  border-radius: 14px;
  margin-top: 16px;
  transition: all 0.3s ease;
}
.premium-card-inner:hover {
  box-shadow: 0 0 16px rgba(91,66,243,0.3);
  transform: translateY(-4px);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade { animation: fadeIn 1s ease; }
/* ===== SUBTLE MOVING BACKGROUND ===== */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 25% 25%, rgba(91,66,243,0.15), transparent 40%),
              radial-gradient(circle at 75% 75%, rgba(75,225,236,0.15), transparent 40%);
  animation: moveBg 25s ease-in-out infinite alternate;
  z-index: -1;
}
@keyframes moveBg {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-25%, -25%) scale(1.2); }
}
/* SweetAlert Themes */

.swal-success {
  background: radial-gradient(circle at top, #0b1e17, #05100c);
  color: #aaffc3;
  box-shadow: 0 0 20px #00ff8899;
}
.swal-error {
  background: linear-gradient(135deg, #1a0000, #3d0000);
  color: #ffb3b3;
  box-shadow: 0 0 20px #ff003399;
}
.swal-info {
  background: rgba(20, 20, 35, 0.95);
  color: #cfd8ff;
  box-shadow: 0 0 20px #627bff55;
}
.swal-account {
  background: linear-gradient(145deg, #0b111a, #101a2b);
  color: #b0d0ff;
  box-shadow: 0 0 25px #3f6cff66;
}
/* 🌌 Swals refined with glowing theme */
.swal-scan {
  border: 1px solid rgba(78, 188, 255, 0.4);
  box-shadow: 0 0 30px rgba(72, 209, 255, 0.3);
  backdrop-filter: blur(12px);
}

.swal-premium {
  border: 1px solid rgba(0, 255, 230, 0.3);
  box-shadow: 0 0 35px rgba(0, 255, 200, 0.2);
  backdrop-filter: blur(10px);
}

.swal-safe {
  border: 1px solid rgba(0, 255, 120, 0.3);
  box-shadow: 0 0 25px rgba(0, 255, 120, 0.2);
  backdrop-filter: blur(8px);
}
.cat-block {
  margin: 10px 0;
  padding: 10px;
  background: rgba(20, 25, 35, 0.6);
  border-radius: 8px;
  border-left: 3px solid #00eaff99;
}
.ing-item {
  margin: 6px 0;
  font-size: 0.9em;
}
/* ✨ Smooth fade transitions for Clarivana UI */
.fade-out {
  opacity: 0;
  transform: scale(0.98);
  filter: blur(3px);
  transition: all 0.4s ease-in;
}

.fade-in {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
  transition: all 0.6s ease-out;
}
/* Loader */
.progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease-in;
}

.progress-ring { text-align: center; color: #fff; }
.spinner {
  width: 80px; height: 80px;
  border: 5px solid rgba(255,255,255,0.2);
  border-top: 5px solid #00ffcc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

/* Scan results */
.scan-result {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 90%;
  max-width: 420px;
  animation: fadeIn 0.5s ease-out;
}

.result-card {
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

.result-card.safe {
  background: linear-gradient(135deg, #0f5132, #198754);
  color: #d1fae5;
}

.result-card.unsafe {
  background: linear-gradient(135deg, #7f1d1d, #dc2626);
  color: #fee2e2;
}

.rescan-btn {
  margin-top: 15px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}
.rescan-btn:hover { background: rgba(255,255,255,0.4); }
