/* Analytical-specific animation styles */

/* Common styles for all analytical animations */
.analytical-animation {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 20px;
  background-color: rgba(250, 250, 250, 0.7);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Sample Preparation Animation - Advanced Auto-Sampler */
.mortar-container {
  background-color: rgba(230, 245, 255, 0.8);
  border: 1px solid var(--sample-prep-color);
}

.autosampler-base {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 30px;
  background-color: #424242;
  border-radius: 5px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.carousel {
  position: absolute;
  bottom: 45px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 10px;
  background-color: #757575;
  border-radius: 5px;
  animation: rotate 6s infinite linear;
}

.sample-vial {
  position: absolute;
  width: 14px;
  height: 25px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #9e9e9e;
  border-radius: 3px 3px 5px 5px;
  bottom: 8px;
}

.vial-1 {
  left: 10px;
}

.vial-2 {
  left: 30px;
}

.vial-3 {
  left: 50px;
}

.vial-4 {
  left: 70px;
}

.vial-5 {
  left: 90px;
}

.robotic-arm {
  position: absolute;
  top: 30px;
  left: 80px;
  width: 10px;
  height: 60px;
  background-color: #616161;
  animation: armMove 4s infinite ease-in-out;
  transform-origin: top center;
}

.arm-head {
  position: absolute;
  bottom: -10px;
  left: -5px;
  width: 20px;
  height: 15px;
  background-color: #424242;
  border-radius: 3px;
}

.injector {
  position: absolute;
  width: 5px;
  height: 20px;
  background-color: #e0e0e0;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
}

.sample-transfer {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: var(--sample-prep-color);
  border-radius: 50%;
  opacity: 0;
  top: 100px;
  left: 125px;
  animation: transferSample 4s infinite ease-in-out;
}

/* Instrumentation Animation - Modern HPLC System */
.instrument-container {
  background-color: rgba(245, 235, 255, 0.8);
  border: 1px solid var(--instrumentation-color);
}

.hplc-system {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 70px;
  background-color: #424242;
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.system-display {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 70px;
  height: 30px;
  background-color: #212121;
  border-radius: 3px;
  overflow: hidden;
}

.display-data {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 60px;
  height: 20px;
  background-color: #43a047;
  opacity: 0.8;
  clip-path: polygon(0 50%, 10% 40%, 20% 65%, 30% 30%, 40% 40%, 50% 20%, 60% 40%, 70% 35%, 80% 50%, 90% 45%, 100% 50%);
  animation: displayFlicker 2s infinite ease-in-out;
}

.column-compartment {
  position: absolute;
  top: -80px;
  left: 20px;
  width: 25px;
  height: 80px;
  background: linear-gradient(to right, #757575, #9e9e9e, #757575);
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.column-compartment::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  width: 15px;
  height: 70px;
  background: linear-gradient(to bottom, 
    rgba(230, 230, 230, 0.5) 0%,
    rgba(var(--instrumentation-color), 0.3) 30%,
    rgba(var(--instrumentation-color), 0.2) 70%,
    rgba(230, 230, 230, 0.5) 100%
  );
  animation: columnFlow 3s infinite ease-in-out;
  border-radius: 2px;
}

.detector-module {
  position: absolute;
  top: -50px;
  right: 15px;
  width: 40px;
  height: 50px;
  background-color: #616161;
  border-radius: 5px;
  border: 2px solid #424242;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.detector-light {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 15px;
  background: radial-gradient(#f44336, #b71c1c);
  border-radius: 50%;
  animation: detectorPulse 2s infinite;
}

.connection-tube {
  position: absolute;
  top: -30px;
  left: 45px;
  width: 50px;
  height: 3px;
  background-color: #e0e0e0;
  transform: rotate(25deg);
}

.data-screen {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 80px;
  background-color: #212121;
  border-radius: 5px;
  overflow: hidden;
  border: 2px solid #424242;
}

.chromatogram {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 100px;
  height: 60px;
  background-color: rgba(0, 0, 0, 0.7);
}

.chromatogram-peak {
  position: absolute;
  bottom: 10px;
  width: 2px;
  background-color: #4fc3f7;
  animation: peakGrow 3s infinite ease-in-out;
}

.peak-1 {
  left: 20%;
  height: 0;
  animation-delay: 0.5s;
}

.peak-2 {
  left: 40%;
  height: 0;
  animation-delay: 1.5s;
}

.peak-3 {
  left: 60%;
  height: 0;
  animation-delay: 2.5s;
}

.peak-4 {
  left: 80%;
  height: 0;
  animation-delay: 3.5s;
}

@keyframes detectorPulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 5px #f44336;
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 10px #f44336;
  }
}

@keyframes displayFlicker {
  0%, 100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

/* Reagent Animation */
.reagent-container {
  background-color: rgba(255, 245, 235, 0.8);
  border: 1px solid var(--reagent-color);
}

.reagent-flask {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 90px;
  background-color: rgba(255, 255, 255, 0.7);
  border: 2px solid #9e9e9e;
  border-radius: 0 0 40% 40%;
  overflow: hidden;
}

.reagent-flask::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.7);
  border: 2px solid #9e9e9e;
  border-radius: 5px;
}

.reagent-liquid {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(to bottom, 
    rgba(var(--reagent-color), 0.5),
    rgba(var(--reagent-color), 0.8)
  );
  animation: liquidBubble 2s infinite ease-in-out;
}

.reagent-bubble {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: bubbleRise 3s infinite ease-in-out;
}

.bubble-1 {
  bottom: 10px;
  left: 20%;
  animation-delay: 0.2s;
}

.bubble-2 {
  bottom: 15px;
  left: 40%;
  animation-delay: 1.2s;
}

.bubble-3 {
  bottom: 5px;
  left: 60%;
  animation-delay: 0.7s;
}

.bubble-4 {
  bottom: 20px;
  left: 30%;
  animation-delay: 1.7s;
}

.bubble-5 {
  bottom: 8px;
  left: 75%;
  animation-delay: 0.5s;
}

.bubble-6 {
  bottom: 25px;
  left: 55%;
  animation-delay: 1.5s;
}

.pipette {
  position: absolute;
  top: 15px;
  right: 30%;
  width: 15px;
  height: 60px;
  background-color: #e0e0e0;
  border: 1px solid #9e9e9e;
  transform: rotate(45deg);
  transform-origin: top center;
  animation: pipetteDrip 3s infinite ease-in-out;
}

.pipette-drop {
  position: absolute;
  width: 8px;
  height: 12px;
  background-color: rgba(var(--reagent-color), 0.8);
  border-radius: 50%;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  animation: dropFall 3s infinite ease-in-out;
}

/* Waste Animation */
.waste-container {
  background-color: rgba(229, 245, 242, 0.8);
  border: 1px solid var(--waste-color);
}

.waste-flask {
  position: absolute;
  bottom: 30px;
  left: 30%;
  width: 70px;
  height: 80px;
  background-color: rgba(255, 255, 255, 0.5);
  border: 2px solid #9e9e9e;
  border-radius: 0 0 30% 30%;
  overflow: hidden;
}

.waste-liquid {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 70%;
  background: linear-gradient(to bottom, 
    rgba(231, 76, 60, 0.5),
    rgba(231, 76, 60, 0.8)
  );
  animation: wasteBubble 2.5s infinite ease-in-out;
}

.waste-bubble {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  animation: wasteBubbleRise 3s infinite ease-in-out;
}

.w-bubble-1 {
  bottom: 10px;
  left: 20%;
  animation-delay: 0.3s;
}

.w-bubble-2 {
  bottom: 15px;
  left: 50%;
  animation-delay: 1.3s;
}

.w-bubble-3 {
  bottom: 5px;
  left: 70%;
  animation-delay: 0.8s;
}

.w-bubble-4 {
  bottom: 20px;
  left: 35%;
  animation-delay: 1.8s;
}

.waste-filter {
  position: absolute;
  top: 40px;
  right: 25%;
  width: 50px;
  height: 70px;
  background-color: #f5f5f5;
  border: 2px solid #9e9e9e;
  border-radius: 5px;
  overflow: hidden;
}

.waste-filter::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom,
    rgba(26, 188, 156, 0.1),
    rgba(26, 188, 156, 0.3)
  );
  animation: filterPurify 3s infinite ease-in-out;
}

.filter-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: rgba(231, 76, 60, 0.7);
  border-radius: 50%;
  animation: particleFilter 4s infinite ease-in-out;
}

.fp-1 {
  top: 20%;
  left: 30%;
  animation-delay: 0.5s;
}

.fp-2 {
  top: 50%;
  left: 60%;
  animation-delay: 1.5s;
}

.fp-3 {
  top: 70%;
  left: 40%;
  animation-delay: 2.5s;
}

/* Results Animation */
.results-container {
  background-color: rgba(240, 240, 240, 0.8);
  border: 1px solid var(--primary-color);
}

.graph-paper {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 140px;
  height: 140px;
  background-color: white;
  border: 1px solid #e0e0e0;
}

.graph-line {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.1);
}

.h-line {
  width: 100%;
  height: 1px;
  left: 0;
}

.v-line {
  width: 1px;
  height: 100%;
  top: 0;
}

.h-line-0 { top: 0; }
.h-line-1 { top: 20%; }
.h-line-2 { top: 40%; }
.h-line-3 { top: 60%; }
.h-line-4 { top: 80%; }
.h-line-5 { top: 100%; }

.v-line-0 { left: 0; }
.v-line-1 { left: 20%; }
.v-line-2 { left: 40%; }
.v-line-3 { left: 60%; }
.v-line-4 { left: 80%; }
.v-line-5 { left: 100%; }

.data-point {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
  opacity: 0;
  animation: pointAppear 3s infinite ease-out;
}

.point-1 {
  top: 80%;
  left: 20%;
  animation-delay: 0.2s;
}

.point-2 {
  top: 60%;
  left: 40%;
  animation-delay: 0.7s;
}

.point-3 {
  top: 40%;
  left: 60%;
  animation-delay: 1.2s;
}

.point-4 {
  top: 30%;
  left: 80%;
  animation-delay: 1.7s;
}

.point-5 {
  top: 20%;
  left: 90%;
  animation-delay: 2.2s;
}

.trend-line {
  position: absolute;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transform-origin: left center;
  transform: rotate(-20deg);
  top: 80%;
  left: 20%;
  animation: lineGrow 3s infinite ease-out 2.5s;
}

/* Templates Animation */
.templates-container-anim {
  background-color: rgba(240, 240, 240, 0.8);
  border: 1px solid var(--success-color);
}

.template-document {
  position: absolute;
  width: 90px;
  height: 120px;
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transform: rotate(0deg);
}

.doc-1 {
  top: 25px;
  left: 35px;
  z-index: 3;
  animation: docShift 4s infinite ease-in-out;
}

.doc-2 {
  top: 20px;
  left: 30px;
  z-index: 2;
  transform: rotate(-5deg);
  animation: docShift 4s infinite ease-in-out 0.2s;
}

.doc-3 {
  top: 15px;
  left: 25px;
  z-index: 1;
  transform: rotate(-10deg);
  animation: docShift 4s infinite ease-in-out 0.4s;
}

.doc-line {
  position: absolute;
  left: 10px;
  width: 70px;
  height: 3px;
  background-color: #f0f0f0;
  border-radius: 1px;
}

.line-1 { top: 30px; width: 60%; }
.line-2 { top: 50px; width: 80%; }
.line-3 { top: 70px; width: 40%; }
.line-4 { top: 90px; width: 70%; }

.template-checkmark {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 30px;
  height: 30px;
  animation: checkmark 2s infinite ease-in-out;
}

.template-checkmark::before {
  content: '';
  position: absolute;
  width: 3px;
  height: 15px;
  background-color: var(--success-color);
  transform: rotate(45deg);
  bottom: 0;
  left: 8px;
}

.template-checkmark::after {
  content: '';
  position: absolute;
  width: 25px;
  height: 3px;
  background-color: var(--success-color);
  transform: rotate(45deg);
  bottom: 5px;
  left: 5px;
}

/* Animation keyframes */
@keyframes rotate {
  0% {
    transform: translateX(-50%) rotate(0deg);
  }
  100% {
    transform: translateX(-50%) rotate(360deg);
  }
}

@keyframes armMove {
  0%, 100% {
    transform: rotate(-30deg);
  }
  25% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(30deg);
  }
  75% {
    transform: rotate(0deg);
  }
}

@keyframes transferSample {
  0%, 15% {
    opacity: 0;
    top: 100px;
  }
  20%, 40% {
    opacity: 1;
    top: 90px;
  }
  45%, 60% {
    opacity: 1;
    top: 50px;
  }
  65%, 80% {
    opacity: 1;
    top: 30px;
  }
  85%, 100% {
    opacity: 0;
    top: 10px;
  }
}

@keyframes columnFlow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(50px);
  }
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

@keyframes peakGrow {
  0% {
    height: 0;
  }
  40% {
    height: 25px;
  }
  60% {
    height: 25px;
  }
  100% {
    height: 0;
  }
}

@keyframes liquidBubble {
  0%, 100% {
    transform: translateY(0);
    background-color: rgba(var(--reagent-color), 0.7);
  }
  50% {
    transform: translateY(-2px);
    background-color: rgba(var(--reagent-color), 0.8);
  }
}

@keyframes bubbleRise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.6;
  }
  100% {
    transform: translateY(-40px) scale(1.5);
    opacity: 0;
  }
}

@keyframes pipetteDrip {
  0%, 100% {
    transform: rotate(45deg);
  }
  30% {
    transform: rotate(50deg);
  }
}

@keyframes dropFall {
  0%, 70% {
    opacity: 0;
    transform: translateX(-50%) translateY(0);
  }
  75% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  95%, 100% {
    opacity: 0;
    transform: translateX(-50%) translateY(50px);
  }
}

@keyframes wasteBubble {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes wasteBubbleRise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.4;
  }
  100% {
    transform: translateY(-30px) scale(1.2);
    opacity: 0;
  }
}

@keyframes filterPurify {
  0%, 100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.4;
  }
}

@keyframes particleFilter {
  0% {
    transform: translateY(0);
    opacity: 0.7;
  }
  50% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(50px);
    opacity: 0;
  }
}

@keyframes pointAppear {
  0%, 10% {
    opacity: 0;
    transform: scale(0);
  }
  20%, 90% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0.8;
    transform: scale(1);
  }
}

@keyframes lineGrow {
  0% {
    width: 0;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    width: 100px;
    opacity: 1;
  }
}

@keyframes docShift {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }
  50% {
    transform: rotate(3deg) translateY(-5px);
  }
}

@keyframes checkmark {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}