/* 🌌 Balanced Animated AI Gradient Background (Default: DARK) */
body {
  background: linear-gradient(135deg, #1a2433, #243b55, #141e30);
  background-size: 400% 400%;
  animation: gradientFlow 45s ease infinite;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  color: #f1f3f5;
  transition: background 0.6s ease, color 0.6s ease;
}

/* 🎨 Smooth slow-moving gradient flow */
@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* 🔹 Card styling */
.card {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e9ecf2;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 200, 255, 0.25);
}

/* 🌟 Logo Styling */
.logo-img {
  width: 110px;
  height: auto;
  object-fit: contain;
  display: inline-block;
  animation: fadeIn 1s ease-in-out;
  transition: transform 0.25s ease, filter 0.25s ease;
  margin-top: 5px;
  filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.5));
}
.logo-img:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 12px rgba(0, 255, 255, 0.8));
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 🎙️ Mic button */
.mic-button {
  position: relative;
  background: linear-gradient(145deg, #00a8ff, #0072ff);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 18px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  box-shadow: 0 0 12px rgba(0, 162, 255, 0.6);
  overflow: hidden;
}
.mic-button:hover {
  transform: scale(1.08);
  box-shadow: 0 0 22px rgba(0, 162, 255, 0.9);
}
.mic-button.active {
  background: linear-gradient(145deg, #29c76f, #2fe397);
  box-shadow: 0 0 20px rgba(46, 213, 115, 0.95);
}
.mic-button.active::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(46, 213, 115, 0.7);
  animation: micPulse 1.6s ease-in-out infinite;
}
@keyframes micPulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.15;
  }
  100% {
    transform: scale(1);
    opacity: 0.6;
  }
}
.mic-button i {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* 🧹 Clear button */
.clear-button {
  background: linear-gradient(145deg, #ff4d4d, #ff6b6b);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 18px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 12px rgba(255, 80, 80, 0.6);
}
.clear-button:hover {
  transform: scale(1.08);
  box-shadow: 0 0 22px rgba(255, 100, 100, 0.9);
}

/* 📋 Copy button */
.copy-btn {
  background: transparent;
  border: none;
  color: #00ffc8;
  font-size: 16px;
  margin-left: 8px;
  transition: transform 0.2s ease, color 0.2s ease;
}
.copy-btn:hover {
  color: #00ffee;
  transform: scale(1.12);
}
.copy-btn.copied {
  color: #29ff6a;
}

/* Timer */
.timer {
  font-weight: 700;
  font-size: 1.1rem;
  color: #00e6e6;
}

/* Category header */
.category-header {
  background: linear-gradient(90deg, #007bff, #00c6ff);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(0, 198, 255, 0.2);
}

/* Q&A box */
.qa-box {
  background: rgba(0, 255, 180, 0.12);
  border-left: 5px solid #00ffb3;
  border-radius: 10px;
  padding: 10px;
  color: #f3f6f8;
  position: relative;
}

/* Highlight */
mark.hl {
  background: #ffee0088;
  padding: 0 0.2em;
  border-radius: 3px;
}

/* Results container */
.results-container {
  min-height: 120px;
  margin-bottom: 30px;
}

/* Tag buttons */
.tag-btn {
  border-radius: 20px;
  padding: 6px 12px;
  color: #00c6ff;
  border: 1px solid #00c6ff;
  background: transparent;
  transition: all 0.3s ease;
}
.tag-btn:hover {
  background-color: #00c6ff;
  color: #0e1116;
  box-shadow: 0 0 10px rgba(0, 230, 230, 0.7);
}

/* Primary button */
.btn-primary {
  background: linear-gradient(90deg, #0072ff, #00c6ff);
  border: none;
  border-radius: 10px;
  transition: all 0.25s ease;
  box-shadow: 0 0 10px rgba(0, 150, 255, 0.4);
  color: #fff;
}
.btn-primary:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.8);
  filter: brightness(1.1);
}

/* Inputs */
.form-control,
.form-select {
  background-color: rgba(255, 255, 255, 0.08);
  color: #f1f3f5;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}
.form-control::placeholder {
  color: #aeb4bb;
}
.form-control:focus,
.form-select:focus {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: #00bfff;
  box-shadow: 0 0 0 0.2rem rgba(0, 198, 255, 0.25);
}

/* Footer */
footer {
  background: rgba(255, 255, 255, 0.1);
  color: #f0f3f7;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.25);
}
@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 🌙 Light Theme */
html[data-theme="light"] body {
  background: linear-gradient(135deg, #f2f6ff, #e9f1ff, #eef5ff);
  color: #0b1726;
}
html[data-theme="light"] .card {
  background: rgba(255, 255, 255, 0.9);
  color: #0b1726;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .qa-box {
  background: rgba(0, 190, 160, 0.08);
  color: #0b1726;
  border-left-color: #00c19a;
}
html[data-theme="light"] .tag-btn {
  color: #0057c7;
  border-color: #5bb0ff;
}
html[data-theme="light"] .tag-btn:hover {
  background: #5bb0ff;
  color: #062246;
}
html[data-theme="light"] .btn-primary {
  background: linear-gradient(90deg, #2b7bff, #4fc3ff);
}
html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select {
  background-color: rgba(0, 0, 0, 0.03);
  color: #0b1726;
  border: 1px solid rgba(0, 0, 0, 0.12);
}
html[data-theme="light"] .form-control::placeholder {
  color: #5b6a7c;
}
html[data-theme="light"] .form-control:focus,
html[data-theme="light"] .form-select:focus {
  background-color: rgba(255, 255, 255, 0.95);
  color: #0b1726;
  box-shadow: 0 0 0 0.2rem rgba(0, 110, 255, 0.15);
  border-color: #7bb3ff;
}
html[data-theme="light"] footer {
  background: rgba(255, 255, 255, 0.9);
  color: #263242;
  border-top-color: rgba(0, 0, 0, 0.08);
}

/* ✅ Mobile optimization */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  .card {
    padding: 15px !important;
    border-radius: 12px;
  }
  .logo-img {
    width: 85px;
  }
  .mic-button,
  .clear-button {
    width: 40px;
    height: 40px;
    font-size: 15px;
  }
  .input-group button {
    font-size: 14px;
    padding: 8px;
  }
  footer {
    font-size: 13px;
    padding: 8px;
  }
}
