/* Virtual Biology Lab Styles */

:root {
  --lab-primary: #2563eb;
  --lab-secondary: #7c3aed;
  --lab-accent: #059669;
  --lab-warning: #d97706;
  --lab-danger: #dc2626;
}

/* General Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.section {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.section.active {
  display: block;
}

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

/* Navigation Styles */
.nav-btn {
  transition: all 0.3s ease;
  transform: scale(1);
}

.nav-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.nav-btn.active {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Vitamin Cards */
.vitamin-card {
  transition: all 0.3s ease;
  transform: scale(1);
}

.vitamin-card:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Product Cards */
.product-card {
  transition: all 0.3s ease;
  transform: scale(1);
}

.product-card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.product-card.selected {
  border-color: var(--lab-primary);
  background-color: #eff6ff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.product-card.selected .vitamin-level {
  display: block;
}

/* Experiment Animation */
.experiment-step {
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.5s ease;
}

.experiment-step.active {
  opacity: 1;
  transform: translateX(0);
}

.experiment-step.completed {
  background-color: #f0fdf4;
  border-color: #22c55e;
}

/* Test Tube Animation */
.test-tube {
  width: 60px;
  height: 120px;
  background: linear-gradient(to bottom, #f3f4f6 0%, #f3f4f6 80%, #3b82f6 80%, #3b82f6 100%);
  border: 2px solid #6b7280;
  border-radius: 0 0 30px 30px;
  position: relative;
  margin: 0 auto;
  transition: all 0.5s ease;
}

.test-tube.reacting {
  animation: reaction 1s ease-in-out;
}

.test-tube.positive {
  background: linear-gradient(to bottom, #f0fdf4 0%, #f0fdf4 80%, #22c55e 80%, #22c55e 100%);
}

.test-tube.negative {
  background: linear-gradient(to bottom, #fef2f2 0%, #fef2f2 80%, #ef4444 80%, #ef4444 100%);
}

@keyframes reaction {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.1) rotate(-2deg); }
  50% { transform: scale(1.1) rotate(2deg); }
  75% { transform: scale(1.1) rotate(-1deg); }
}

/* Progress Bar */
.progress-bar {
  background-color: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  height: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--lab-primary), var(--lab-accent));
  width: 0%;
  transition: width 0.3s ease;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--lab-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Protocol Styles */
.protocol-section {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.protocol-header {
  text-align: center;
  border-bottom: 2px solid #374151;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.protocol-field {
  display: flex;
  margin-bottom: 0.75rem;
  align-items: flex-start;
}

.protocol-field-label {
  font-weight: 600;
  min-width: 150px;
  color: #374151;
}

.protocol-field-value {
  flex: 1;
  color: #1f2937;
}

/* Results Table */
.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.results-table th,
.results-table td {
  border: 1px solid #d1d5db;
  padding: 0.75rem;
  text-align: left;
}

.results-table th {
  background-color: #f9fafb;
  font-weight: 600;
  color: #374151;
}

.results-table tr:nth-child(even) {
  background-color: #f9fafb;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .nav-btn {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }
  
  .vitamin-card,
  .product-card {
    margin-bottom: 1rem;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .protocol-field {
    flex-direction: column;
  }
  
  .protocol-field-label {
    margin-bottom: 0.25rem;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
  }
  
  .nav-btn,
  button {
    display: none;
  }
  
  .section {
    display: block !important;
  }
  
  #theory,
  #experiment {
    display: none !important;
  }
  
  #protocol {
    display: block !important;
  }
  
  .vitamin-card,
  .product-card {
    break-inside: avoid;
  }
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(37, 99, 235, 0.3);
  border-radius: 50%;
  border-top-color: var(--lab-primary);
  animation: spin 1s ease-in-out infinite;
}

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

/* Success/Error Messages */
.message {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.message.success {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.message.error {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.message.warning {
  background-color: #fffbeb;
  color: #d97706;
  border: 1px solid #fed7aa;
}

/* Tooltip */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1f2937;
  color: white;
  padding: 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.tooltip:hover::before {
  opacity: 1;
}

/* Chemical Formula */
.chemical-formula {
  font-family: 'Times New Roman', serif;
  font-weight: normal;
}

.subscript {
  font-size: 0.8em;
  vertical-align: sub;
}

/* Experiment Status */
.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.status-waiting {
  background-color: #d1d5db;
}

.status-active {
  background-color: #f59e0b;
  animation: pulse 2s infinite;
}

.status-completed {
  background-color: #10b981;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}