/* THEME VARIABLES */
:root {
  --bg: #050509;
  --text: #ffffff;
  --accent: #a855f7;
  --accent2: #22d3ee;
  --glow: 0 0 25px rgba(168, 85, 247, 0.8);
  --card-bg: rgba(15, 23, 42, 0.9);
}

.light-mode {
  --bg: #f3f4f6;
  --text: #020617;
  --accent: #7c3aed;
  --accent2: #0ea5e9;
  --glow: 0 0 20px rgba(124, 58, 237, 0.7);
  --card-bg: rgba(248, 250, 252, 0.95);
}

/* GLOBAL */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Oxanium", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  text-align: center;
  transition: background 0.4s ease, color 0.3s ease;
}

/* ANIMATED RGB BACKGROUND */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(168, 85, 247, 0.2), transparent 60%),
    radial-gradient(circle at 80% 30%, rgba(34, 211, 238, 0.25), transparent 60%),
    radial-gradient(circle at 50% 80%, rgba(239, 68, 68, 0.25), transparent 60%);
  filter: blur(70px);
  opacity: 0.9;
  z-index: -1;
  animation: rgbPulse 8s infinite alternate ease-in-out;
}

@keyframes rgbPulse {
  0% {
    opacity: 0.6;
    filter: blur(60px);
  }
  50% {
    opacity: 1;
    filter: blur(80px);
  }
  100% {
    opacity: 0.7;
    filter: blur(70px);
  }
}

/* HEADER */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.wolf-logo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  box-shadow: 0 0 25px rgba(147, 51, 234, 0.9);
  animation: wolfPulse 3s ease-in-out infinite alternate, rgbOutline 6s infinite;
}

@keyframes wolfPulse {
  from {
    transform: scale(1) rotate(0deg);
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.7);
  }
  to {
    transform: scale(1.06) rotate(-2deg);
    box-shadow: 0 0 35px rgba(244, 114, 182, 0.9);
  }
}

@keyframes rgbOutline {
  0% { box-shadow: 0 0 20px #a855f7; }
  50% { box-shadow: 0 0 30px #22d3ee; }
  100% { box-shadow: 0 0 20px #ef4444; }
}

.logo-text h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 1px;
  text-shadow: var(--glow);
}

.logo-text span {
  font-size: 12px;
  opacity: 0.8;
}

/* MAIN CARD */
main {
  max-width: 600px;
  margin: 20px auto 60px;
  padding: 25px;
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow:
    0 0 25px rgba(15, 23, 42, 0.9),
    0 0 30px rgba(148, 163, 184, 0.1);
  text-align: center;
}

main p {
  margin-top: 0;
  margin-bottom: 15px;
  opacity: 0.9;
}

/* SELECT */
select {
  padding: 10px;
  font-size: 16px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background-color: #020617;
  color: #e5e7eb;
  margin-bottom: 20px;
  transition: 0.2s ease;
}

.light-mode select {
  background-color: #e5e7eb;
  color: #020617;
}

select:hover {
  transform: scale(1.03);
  border-color: var(--accent2);
}

/* BUTTONS */
button {
  padding: 10px 22px;
  font-size: 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--glow);
}

button:hover {
  transform: translateY(-1px) scale(1.03);
}

button:active {
  transform: translateY(1px) scale(0.97);
}

/* MODE TOGGLE BUTTON */
#modeToggle {
  font-size: 14px;
  padding: 8px 16px;
}

/* ACTION ROWS */
.actions-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

/* RESULT */
#result {
  margin-top: 25px;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent2);
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.9);
  min-height: 40px;
}

.fade {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* MODAL */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.modal-content {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 14px;
  width: 320px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: var(--glow);
  text-align: left;
}

.modal-content h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

.modal-content h3 {
  margin-bottom: 6px;
  margin-top: 12px;
  font-size: 15px;
}

#closeModal {
  float: right;
  cursor: pointer;
  font-size: 24px;
}

/* LISTS */
#historyList,
#favoritesList {
  list-style: none;
  padding-left: 0;
  margin-top: 0;
  font-size: 14px;
}

#historyList li,
#favoritesList li {
  padding: 4px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

/* SCROLLBAR */
.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.7);
  border-radius: 999px;
}