/* Custom styles for Biology Lab Simulation */

/* Tab system */
.tab-btn {
    @apply bg-gray-100 text-gray-600 hover:bg-green-100 hover:text-green-700;
}

.tab-btn.active {
    @apply bg-green-500 text-white hover:bg-green-600;
}

.tab-content {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Range sliders */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #10b981;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    border: 2px solid #065f46;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #059669;
    transform: scale(1.1);
}

input[type="range"]::-moz-range-track {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    background: #10b981;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    border: 2px solid #065f46;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Plant visualization */
#plant-container {
    overflow: hidden;
}

/* Water vapor animation */
.vapor-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(59, 130, 246, 0.6);
    border-radius: 50%;
    animation: float-up 3s linear infinite;
    pointer-events: none;
}

@keyframes float-up {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-200px) scale(1.2);
    }
}

/* Measurements table */
#measurements-table table {
    border-collapse: collapse;
}

#measurements-table th,
#measurements-table td {
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
}

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

#measurements-table tbody tr:hover {
    background-color: #ecfdf5;
}

/* Protocol section */
#protocol-section input,
#protocol-section textarea {
    transition: border-color 0.2s ease;
}

#protocol-section input:focus,
#protocol-section textarea:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Print styles for protocol */
@media print {
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .no-print {
        display: none !important;
    }
    
    .bg-white {
        background: white !important;
    }
    
    .shadow-md {
        box-shadow: none !important;
    }
    
    .rounded-lg {
        border-radius: 0 !important;
    }
    
    #protocol-section {
        margin: 0 !important;
        padding: 20pt !important;
    }
    
    button {
        display: none !important;
    }
    
    nav {
        display: none !important;
    }
    
    header h1, header h2 {
        color: black !important;
    }
}

/* Custom animations for environmental effects */
.wind-effect {
    animation: sway 2s ease-in-out infinite;
}

@keyframes sway {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(2px) rotate(1deg); }
    75% { transform: translateX(-2px) rotate(-1deg); }
}

.temperature-high {
    filter: hue-rotate(30deg) brightness(1.2);
}

.temperature-low {
    filter: hue-rotate(-30deg) brightness(0.8);
}

.humidity-high {
    opacity: 0.8;
}

/* Interactive elements */
.hover-grow {
    transition: transform 0.2s ease;
}

.hover-grow:hover {
    transform: scale(1.05);
}

/* Success/Error states */
.success {
    border-left: 4px solid #10b981;
    background-color: #ecfdf5;
    color: #065f46;
}

.error {
    border-left: 4px solid #ef4444;
    background-color: #fef2f2;
    color: #991b1b;
}

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

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

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