/* Classless CSS - Targeting Tags Directly */
:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --accent: #6c5ce7;
  --accent-hover: #a29bfe;
  --secondary: #f0f2f5;
  --border: #ddd;
  --success: #00b894;
  --warning: #fdcb6e;
  --font-family: "Outfit", "Inter", -apple-system, sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --text: #e0e0e0;
    --accent: #81ecec;
    --accent-hover: #00cec9;
    --secondary: #1e1e1e;
    --border: #333;
  }
}

/* Manual Override from LocalStorage */
[data-theme="dark"] {
  --bg: #121212;
  --text: #e0e0e0;
  --accent: #81ecec;
  --accent-hover: #00cec9;
  --secondary: #1e1e1e;
  --border: #333;
}

[data-theme="light"] {
  --bg: #ffffff;
  --text: #1a1a1a;
  --accent: #6c5ce7;
  --accent-hover: #a29bfe;
  --secondary: #f0f2f5;
  --border: #ddd;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-family);
  line-height: 1.6;
  margin: 0;
  padding: 2rem;
  max-width: 800px;
  margin-inline: auto;
  transition: var(--transition);
}

header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeInDown 0.8s ease-out;
}

h1 {
  font-size: 2.5rem;
  margin: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

form {
  background: var(--secondary);
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
  animation: fadeInUp 0.8s ease-out;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1.5rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  transition: var(--transition);
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

input[type="range"] {
  width: 100%;
  margin-bottom: 1.5rem;
  accent-color: var(--accent);
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

legend {
  padding: 0 0.5rem;
  font-weight: bold;
  font-size: 0.8rem;
}

div[style*="display: flex"] {
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

button {
  cursor: pointer;
  padding: 0.8rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  transition: var(--transition);
  width: 100%;
  font-size: 1rem;
}

button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

button:active {
  transform: translateY(0);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2rem;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  animation: fadeIn 1s ease-in;
}

th {
  background: var(--secondary);
  text-align: left;
  padding: 1rem;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: none;
}
tr:nth-child(even) {
  background: var(--secondary);
  opacity: 0.9;
}

details {
  margin-top: 2rem;
  background: var(--secondary);
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}

summary {
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

footer {
  margin-top: 4rem;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.6;
  padding-bottom: 2rem;
}

.controls {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
}

.controls button {
  width: auto;
  padding: 0.5rem;
  background: var(--secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Mobile Adjustments */
@media (max-width: 600px) {
  body {
    padding: 1rem;
  }
  h1 {
    font-size: 1.8rem;
  }
  form {
    padding: 1rem;
  }
}
