/* Custom styles for Biology Virtual Lab */

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

/* Header animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

/* Tissue card hover effects */
.tissue-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.tissue-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.tissue-card:hover::before {
    left: 100%;
}

.tissue-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Drag and Drop styles */
.drop-zone {
    min-height: 120px;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
    transition: all 0.3s ease;
    position: relative;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
}

.drop-zone.dragover {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.1);
}

.drop-zone.dragover::before {
    opacity: 1;
}

.drop-zone h4 {
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    font-size: 0.9rem;
}

/* Draggable items */
.draggable {
    transition: all 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.dragging {
    opacity: 0.6;
    transform: rotate(5deg) scale(0.95);
}

/* Result animations */
.correct {
    animation: correctPulse 0.6s ease-in-out;
}

.incorrect {
    animation: incorrectShake 0.6s ease-in-out;
}

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

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Navigation active states */
.nav-btn {
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-btn:hover::before {
    left: 100%;
}

/* Modal improvements */
.modal {
    backdrop-filter: blur(5px);
}

.modal-content {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Form enhancements */
input, textarea, select {
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Button enhancements */
button {
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

button:active {
    transform: scale(0.98);
}

/* Progress indicators */
.progress-bar {
    height: 4px;
    background: linear-gradient(90deg, #10b981, #3b82f6, #8b5cf6);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

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

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

/* Microscope animation */
@keyframes microscopeRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-microscope:hover {
    animation: microscopeRotate 1s ease-in-out;
}

/* Image loading states */
img {
    transition: opacity 0.3s ease;
}

img[src*="placeholder"] {
    filter: grayscale(100%);
    opacity: 0.7;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .tissue-card {
        margin-bottom: 12px;
    }
    
    .drop-zone {
        min-height: 100px;
        padding: 12px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        max-height: 90vh;
    }
    
    .nav-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

/* Print styles */
@media print {
    .nav-btn, button, .modal {
        display: none !important;
    }
    
    .bg-white {
        background: white !important;
    }
    
    .text-green-600, .text-purple-600, .text-blue-600 {
        color: black !important;
    }
    
    .border-green-200, .border-purple-200, .border-gray-300 {
        border-color: black !important;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #10b981, #3b82f6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #059669, #2563eb);
}

/* Section transitions */
.lab-section {
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.lab-section.active {
    opacity: 1;
    transform: translateY(0);
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #1f2937;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    font-size: 0.8rem;
    
    /* Position */
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    
    /* Fade in tooltip */
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Success/Error message styles */
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message.success {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-left: 4px solid #10b981;
    color: #065f46;
}

.message.error {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

/* Lab equipment styling */
.lab-equipment {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    margin: 8px 0;
}

.equipment-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border-radius: 6px;
    font-size: 14px;
}