/* Virtual Biology Lab - Custom Styles */

/* Base styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
}

/* Section management */
.section {
  transition: all 0.3s ease-in-out;
}

.section.hidden {
  display: none;
}

/* Interactive elements */
.hover\:shadow-lg:hover {
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Eye chart specific styles */
#eye-chart {
  font-family: monospace;
  letter-spacing: 2px;
  user-select: none;
}

#eye-chart > div {
  margin: 8px 0;
}

/* Field test styles */
.field-test-point {
  animation: pulse 0.5s ease-in-out;
  transition: all 0.2s ease;
}

.field-test-point:hover {
  fill: #dc2626 !important;
  stroke: #991b1b !important;
  stroke-width: 3 !important;
  r: 10 !important;
}

@keyframes pulse {
  0% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

/* Visual field test SVG */
svg circle {
  transition: all 0.2s ease;
}

/* Navigation cards */
nav > div {
  transition: all 0.3s ease;
  cursor: pointer;
}

nav > div:hover {
  transform: translateY(-2px);
}

nav > div.active {
  ring: 2px solid #3b82f6;
}

/* Form elements */
input[type="text"], 
input[type="email"], 
select, 
textarea {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus, 
input[type="email"]:focus, 
select:focus, 
textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

/* Buttons */
button {
  transition: all 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Progress indicators */
.progress-bar {
  background: linear-gradient(90deg, #3b82f6, #10b981);
  height: 4px;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Anatomy diagram hover effects */
.anatomy-part {
  transition: all 0.2s ease;
  cursor: pointer;
}

.anatomy-part:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
}

/* Result cards */
.result-card {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-left: 4px solid #3b82f6;
}

.result-card.success {
  border-left-color: #10b981;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.result-card.warning {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.result-card.error {
  border-left-color: #ef4444;
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

/* Typography */
.gradient-text {
  background: linear-gradient(135deg, #3b82f6, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Loading states */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: loading 2s infinite;
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .section {
    display: block !important;
    break-inside: avoid;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  h1, h2, h3 {
    break-after: avoid;
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  #eye-chart {
    font-size: 0.8em;
    padding: 1rem;
  }
  
  .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  
  .grid-cols-1.lg\:grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .bg-gradient-to-br {
    background: white;
  }
  
  .shadow-md {
    border: 2px solid #000;
  }
  
  .text-gray-600 {
    color: #000;
  }
  
  .text-gray-700 {
    color: #000;
  }
}

/* Focus indicators for keyboard navigation */
button:focus,
select:focus,
input:focus,
textarea:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Tooltip styles */
.tooltip {
  position: relative;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
}

.tooltip:hover::before {
  opacity: 1;
  visibility: visible;
  bottom: calc(100% + 0.5rem);
}

/* Animation classes */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
  animation: slideUp 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Eye diagram interactive parts */
.eye-part {
  cursor: pointer;
  transition: all 0.2s ease;
}

.eye-part:hover {
  opacity: 0.8;
  transform: scale(1.02);
}

/* Color-coded learning sections */
.cornea-highlight { background-color: rgba(59, 130, 246, 0.1); }
.iris-highlight { background-color: rgba(16, 185, 129, 0.1); }
.pupil-highlight { background-color: rgba(245, 158, 11, 0.1); }
.lens-highlight { background-color: rgba(139, 92, 246, 0.1); }
.retina-highlight { background-color: rgba(239, 68, 68, 0.1); }