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

body {
  background-color: #0a0e1a;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(0, 255, 200, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 120, 255, 0.04) 0%, transparent 50%);
}

/* Hexagonal grid pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' viewBox='0 0 60 52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l25.98 15v30L30 60 4.02 45V15z' fill='none' stroke='%231e2d4a' stroke-width='0.3' stroke-opacity='0.3'/%3E%3C/svg%3E");
  background-size: 60px 52px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

#root {
  position: relative;
  z-index: 1;
}

/* Glow effect for formula */
.formula-glow {
  text-shadow:
    0 0 10px rgba(0, 255, 200, 0.6),
    0 0 30px rgba(0, 255, 200, 0.3),
    0 0 60px rgba(0, 255, 200, 0.15);
}

.formula-glow-subtle {
  text-shadow:
    0 0 6px rgba(0, 255, 200, 0.4),
    0 0 15px rgba(0, 255, 200, 0.15);
}

/* Input glow on focus */
.input-glow:focus {
  box-shadow:
    0 0 0 2px rgba(0, 255, 200, 0.3),
    0 0 20px rgba(0, 255, 200, 0.1);
}

/* Synthesize button animations */
.btn-synthesize {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-synthesize::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgba(0, 255, 200, 0.15) 25%,
    transparent 50%
  );
  animation: spin 3s linear infinite;
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-synthesize:hover::before {
  opacity: 1;
}

.btn-synthesize:hover {
  transform: scale(1.02);
  box-shadow: 0 0 30px rgba(0, 255, 200, 0.2);
}

.btn-synthesize:active {
  transform: scale(0.98);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Formula appear animation */
@keyframes formulaAppear {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(20px);
    filter: blur(10px);
  }
  50% {
    opacity: 1;
    transform: scale(1.08) translateY(-5px);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

.formula-enter {
  animation: formulaAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Bubble particles */
@keyframes bubble {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0);
  }
  20% {
    opacity: 1;
    transform: translateY(-10px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-80px) scale(0.3);
  }
}

.bubble {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 255, 200, 0.5);
  animation: bubble 1.2s ease-out forwards;
  pointer-events: none;
}

/* History item animation */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.history-item {
  animation: slideIn 0.3s ease-out forwards;
}

/* Copy feedback */
@keyframes copyPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.copy-pulse {
  animation: copyPulse 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #0a0e1a;
}

::-webkit-scrollbar-thumb {
  background: #1e2d4a;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a5a7c;
}

/* Card shine effect */
.card-shine {
  position: relative;
  overflow: hidden;
}

.card-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(0, 255, 200, 0.03) 50%,
    transparent 60%
  );
  pointer-events: none;
}

/* Periodic table mini styles */
.element-cell {
  transition: all 0.15s ease;
}

.element-cell:hover {
  background: rgba(0, 255, 200, 0.15);
  transform: scale(1.1);
  z-index: 10;
}

/* Flask emoji animation */
@keyframes flask-wobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

.flask-wobble:hover {
  animation: flask-wobble 0.5s ease-in-out;
}