@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {
  --primary-blue: #3b82f6;
  --primary-blue-dark: #1e40af;
  --primary-blue-light: #eff6ff;
  --success-green: #10b981;
  --error-red: #ef4444;
  --warning-yellow: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: linear-gradient(
    135deg,
    var(--primary-blue) 0%,
    var(--primary-blue-dark) 100%
  );
}

.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.glass-effect {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  border-radius: 1rem;
}

.input-group {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.input-group:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-blue) 0%,
    var(--primary-blue-dark) 100%
  );
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: #6b7280;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #4b5563;
  transform: translateY(-2px);
}

.btn-danger {
  background: #ef4444;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

.result-card {
  animation: slideIn 0.5s ease-out;
}

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

.field-calculate {
  border-color: var(--primary-blue) !important;
  background-color: var(--primary-blue-light) !important;
}

.field-calculate:focus {
  outline: none;
  ring-color: var(--primary-blue) !important;
  border-color: var(--primary-blue) !important;
}

.calculate-hint {
  position: absolute;
  top: -8px;
  right: 10px;
  background: var(--primary-blue);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.history-card {
  transition: all 0.3s ease;
}

.history-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  z-index: 10;
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 100%;
  margin: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.formula-display {
  font-family: "Courier New", monospace;
  background: #f3f4f6;
  padding: 1rem;
  border-radius: 0.5rem;
  border-left: 4px solid var(--primary-blue);
}

.message {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  color: white;
  font-weight: 500;
  z-index: 100;
  animation: slideInRight 0.3s ease-out;
}

.message.success {
  background-color: var(--success-green);
}

.message.error {
  background-color: var(--error-red);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .modal-content {
    margin: 1rem;
    padding: 1.5rem;
  }
}
