* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --bg-dark: #0f0f23;
  --bg-card: #1a1a2e;
  --bg-input: #16213e;
  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 2rem 1rem;
  background-image: radial-gradient(
      circle at 20% 50%,
      rgba(102, 126, 234, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(118, 75, 162, 0.1) 0%,
      transparent 50%
    );
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  text-align: center;
  animation: fadeInDown 0.6s ease-out;
}

.subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  font-size: 1rem;
  animation: fadeInUp 0.6s ease-out;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: fadeIn 0.6s ease-out;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: fit-content;
  position: sticky;
  top: 2rem;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5);
}

.input-group {
  margin-bottom: 1rem;
}

.input-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.main-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

input[type="number"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  font-family: "Inter", sans-serif;
  transition: all 0.3s ease;
  outline: none;
}

input[type="number"]:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

input[type="number"]:hover {
  border-color: rgba(102, 126, 234, 0.5);
}

/* Remove spinner arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

.ratio-section {
  margin-top: 1.5rem;
}

.ratio-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease-out;
}

.ratio-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(102, 126, 234, 0.3);
}

.ratio-separator {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Inter", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-remove {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding: 0;
}

.btn-remove:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(238, 90, 111, 0.4);
}

.btn-remove:active {
  transform: scale(0.95);
}

.btn-add {
  background: var(--primary-gradient);
  color: white;
  width: 100%;
  margin-top: 1rem;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-add:active {
  transform: translateY(0);
}

.results-container {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: fadeIn 0.6s ease-out 0.2s backwards;
  min-height: 400px;
}

.results-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: var(--secondary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-item {
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  margin-bottom: 1rem;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  animation: resultFadeIn 0.4s ease-out;
}

.result-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(5px);
}

.result-item.correct {
  border-color: var(--success-color);
  background: rgba(16, 185, 129, 0.1);
}

.result-item.incorrect {
  border-color: var(--error-color);
  background: rgba(239, 68, 68, 0.1);
}

.result-text {
  font-size: 1.2rem;
  font-weight: 600;
  font-family: "Courier New", monospace;
  display: flex;
  gap: 0.5rem;
}

.result-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 0.75rem;
}

.badge-success {
  background: var(--success-color);
  color: white;
}

.badge-error {
  background: var(--error-color);
  color: white;
}

.highlight-correct {
  color: var(--success-color);
  font-weight: 700;
}

.highlight-error {
  color: var(--error-color);
  text-decoration: line-through;
  opacity: 0.7;
}

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

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

@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 slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes resultFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .card {
    position: static;
  }
}

@media (max-width: 768px) {
  .container {
    max-width: 100%;
  }

  h1 {
    font-size: 2rem;
  }

  .card {
    padding: 1.5rem;
  }

  .main-inputs {
    grid-template-columns: 1fr;
  }

  .ratio-row {
    grid-template-columns: 1fr auto 1fr auto;
  }

  .results-container {
    padding: 1.5rem;
    min-height: 300px;
  }
}

footer {
  margin-top: 3rem;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

footer p {
  margin: 0;
}

footer a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

footer a:hover {
  color: #764ba2;
  text-decoration: underline;
}
