/* Custom styles for HVACR Simulator */

/* Circuit diagram animations */
.component {
    transition: all 0.3s ease;
    cursor: pointer;
}

.component:hover {
    filter: brightness(1.2) drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
    transform: scale(1.05);
}

.component.selected {
    stroke: #3b82f6 !important;
    stroke-width: 4 !important;
    filter: brightness(1.1) drop-shadow(0 0 8px #3b82f6);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1.05); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1.05); }
}

/* Digital display effects */
.digital-display {
    background: linear-gradient(145deg, #000, #1a1a1a);
    color: #00ff41;
    font-family: 'Courier New', 'Monaco', monospace;
    text-shadow: 0 0 10px #00ff41;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
    border: 2px solid #333;
    letter-spacing: 0.1em;
}

.digital-display.bg-green-900 {
    background: linear-gradient(145deg, #14532d, #166534);
    animation: flashGreen 0.5s;
}

@keyframes flashGreen {
    0% { background: linear-gradient(145deg, #000, #1a1a1a); }
    50% { background: linear-gradient(145deg, #14532d, #166534); }
    100% { background: linear-gradient(145deg, #000, #1a1a1a); }
}

/* Measurement panel styling */
.measurement-panel {
    background: linear-gradient(145deg, #1a202c, #2d3748);
    border: 1px solid #4a5568;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Scenario cards hover effects */
.scenario-card {
    transition: all 0.3s ease;
}

.scenario-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Button hover effects */
.btn-multimeter {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-multimeter: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;
}

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

/* Refrigerant line animations */
@keyframes flow {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 20; }
}

.refrigerant-line {
    stroke-dasharray: 10 10;
    animation: flow 2s linear infinite;
}

/* Electrical line animations */
@keyframes electricity {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.electrical-line {
    animation: electricity 1s ease-in-out infinite;
}

/* Status indicators */
.status-normal { color: #10b981; }
.status-warning { color: #f59e0b; }
.status-error { color: #ef4444; }
.status-offline { color: #6b7280; }

/* Measurement history styling */
.measurement-entry {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.measurement-entry.voltage { border-left-color: #ef4444; }
.measurement-entry.current { border-left-color: #3b82f6; }
.measurement-entry.resistance { border-left-color: #10b981; }

.measurement-entry:hover {
    background-color: #f3f4f6;
    transform: translateX(4px);
}

/* Feedback animations */
.feedback-correct {
    animation: slideInCorrect 0.5s ease-out;
}

.feedback-incorrect {
    animation: slideInIncorrect 0.5s ease-out;
}

@keyframes slideInCorrect {
    0% {
        opacity: 0;
        transform: translateY(-10px);
        background-color: #dcfce7;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        background-color: #f0fdf4;
    }
}

@keyframes slideInIncorrect {
    0% {
        opacity: 0;
        transform: translateY(-10px);
        background-color: #fecaca;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        background-color: #fef2f2;
    }
}

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

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

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

/* Responsive design */
@media (max-width: 768px) {
    .circuit-diagram svg {
        height: auto;
        max-height: 300px;
    }
    
    .measurement-panel {
        margin-bottom: 1rem;
    }
    
    .digital-display {
        font-size: 1rem;
    }
}

/* Accessibility improvements */
.component:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Tab interface styles */
.tab-button {
    transition: all 0.2s ease;
    position: relative;
}

.tab-button:hover {
    color: #374151;
    border-color: #d1d5db;
}

.tab-button.active {
    color: #2563eb !important;
    border-color: #2563eb !important;
}

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

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

/* Theory content styles */
.theory-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.component-card {
    transition: all 0.2s ease;
}

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

/* Progress bars */
.progress-bar {
    transition: width 0.8s ease-in-out;
}

/* Modal styles */
.modal-overlay {
    backdrop-filter: blur(4px);
}

/* Enhanced reference cards */
.reference-card {
    transition: all 0.2s ease;
    border-left: 4px solid;
}

.reference-card:hover {
    transform: translateX(4px);
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .tab-button {
        font-size: 0.875rem;
        padding: 0.5rem 0.25rem;
    }
    
    .theory-modal {
        margin: 0.5rem;
    }
}

/* Print styles */
@media print {
    .circuit-diagram {
        break-inside: avoid;
    }
    
    .measurement-panel {
        background: white !important;
        color: black !important;
    }
    
    .tab-button, .modal-overlay {
        display: none !important;
    }
}