/* Delta E Measurement Article Specific Styles */
/* Scientific Precision Theme */

/* Primary measurement instrument colors */
:root {
    --precision-dark: #2C3E50;
    --precision-medium: #34495E;
    --scientific-cyan: #00A9E0;
    --precision-orange: #FF6B35;
    --measurement-gray: #7F8C8D;
    --digital-green: #00FF88;
    --error-red: #E74C3C;
    --precision-white: #FFFFFF;
    --grid-lines: rgba(52, 73, 94, 0.2);
}

/* Precision Hero Variant */
.precision-hero {
    background: linear-gradient(135deg, 
        var(--precision-dark) 0%, 
        var(--precision-medium) 50%, 
        var(--precision-dark) 100%);
    position: relative;
    overflow: hidden;
}

.precision-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(0deg, transparent 24%, var(--grid-lines) 25%, var(--grid-lines) 26%, transparent 27%, transparent 74%, var(--grid-lines) 75%, var(--grid-lines) 76%, transparent 77%),
        linear-gradient(90deg, transparent 24%, var(--grid-lines) 25%, var(--grid-lines) 26%, transparent 27%, transparent 74%, var(--grid-lines) 75%, var(--grid-lines) 76%, transparent 77%);
    background-size: 50px 50px;
    opacity: 0.3;
    animation: gridPulse 4s ease-in-out infinite;
}

.precision-hero::after {
    content: '';
    position: absolute;
    top: 20%;
    right: 10%;
    width: 200px;
    height: 150px;
    background: linear-gradient(45deg, 
        var(--scientific-cyan) 0%, 
        var(--precision-orange) 100%);
    clip-path: polygon(20% 0%, 100% 0%, 80% 100%, 0% 100%);
    opacity: 0.15;
    animation: measurementSweep 6s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.1; }
}

@keyframes measurementSweep {
    0% { 
        transform: translateX(0) rotate(0deg);
        opacity: 0.15;
    }
    50% { 
        transform: translateX(-20px) rotate(2deg);
        opacity: 0.25;
    }
    100% { 
        transform: translateX(0) rotate(0deg);
        opacity: 0.15;
    }
}

/* Digital Readout Effects */
.delta-e-value {
    font-family: 'Source Code Pro', 'Courier New', monospace;
    font-weight: 600;
    background: var(--precision-dark);
    color: var(--digital-green);
    padding: 8px 16px;
    border-radius: 4px;
    border: 2px solid var(--scientific-cyan);
    display: inline-block;
    position: relative;
    text-shadow: 0 0 8px var(--digital-green);
    animation: digitalFlicker 3s ease-in-out infinite;
}

.delta-e-value::before {
    content: 'ΔE = ';
    color: var(--scientific-cyan);
    margin-right: 4px;
}

@keyframes digitalFlicker {
    0%, 95%, 100% { opacity: 1; }
    96%, 97% { opacity: 0.8; }
    98%, 99% { opacity: 0.9; }
}

/* Formula Display */
.formula-display {
    background: linear-gradient(135deg, 
        rgba(44, 62, 80, 0.05) 0%, 
        rgba(52, 73, 94, 0.1) 100%);
    border: 2px solid var(--precision-orange);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-family: 'Source Code Pro', monospace;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.formula-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 169, 224, 0.1) 50%, 
        transparent 100%);
    animation: formulaScan 4s ease-in-out infinite;
}

@keyframes formulaScan {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: -100%; }
}

.formula-text {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--precision-dark);
    position: relative;
    z-index: 1;
}

/* Measurement Scale Indicators */
.tolerance-scale {
    display: flex;
    align-items: center;
    margin: 15px 0;
    background: var(--precision-white);
    border: 1px solid var(--measurement-gray);
    border-radius: 6px;
    padding: 8px;
    position: relative;
}

.tolerance-marker {
    flex: 1;
    text-align: center;
    padding: 4px;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.85em;
    font-weight: 500;
    border-right: 1px solid var(--grid-lines);
    position: relative;
}

.tolerance-marker:last-child {
    border-right: none;
}

.tolerance-marker.excellent {
    background: linear-gradient(to right, 
        rgba(0, 255, 136, 0.1) 0%, 
        rgba(0, 255, 136, 0.2) 100%);
    color: #00A854;
}

.tolerance-marker.acceptable {
    background: linear-gradient(to right, 
        rgba(0, 169, 224, 0.1) 0%, 
        rgba(0, 169, 224, 0.2) 100%);
    color: var(--scientific-cyan);
}

.tolerance-marker.noticeable {
    background: linear-gradient(to right, 
        rgba(255, 107, 53, 0.1) 0%, 
        rgba(255, 107, 53, 0.2) 100%);
    color: var(--precision-orange);
}

.tolerance-marker.unacceptable {
    background: linear-gradient(to right, 
        rgba(231, 76, 60, 0.1) 0%, 
        rgba(231, 76, 60, 0.2) 100%);
    color: var(--error-red);
}

/* Precision Badge Enhancement */
.precision-badge {
    background: linear-gradient(135deg, 
        var(--precision-dark) 0%, 
        var(--scientific-cyan) 50%, 
        var(--precision-orange) 100%);
    background-size: 200% 200%;
    animation: precisionShift 5s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.precision-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    animation: precisionSweep 3s ease-in-out infinite;
}

@keyframes precisionShift {
    0%, 100% { 
        background-position: 0% 50%;
        transform: scale(1);
    }
    33% { 
        background-position: 50% 0%;
        transform: scale(1.02);
    }
    66% { 
        background-position: 100% 50%;
        transform: scale(1.01);
    }
}

@keyframes precisionSweep {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: -100%; }
}

/* Measurement Needle Animation */
.measurement-indicator {
    position: relative;
    width: 40px;
    height: 40px;
    border: 3px solid var(--precision-dark);
    border-radius: 50%;
    display: inline-block;
    margin: 0 10px;
    background: var(--precision-white);
}

.measurement-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 15px;
    background: var(--precision-orange);
    transform-origin: center bottom;
    transform: translate(-50%, -100%) rotate(45deg);
    animation: needleSwing 2s ease-in-out infinite;
}

.measurement-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--precision-dark);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

@keyframes needleSwing {
    0%, 100% { transform: translate(-50%, -100%) rotate(30deg); }
    50% { transform: translate(-50%, -100%) rotate(60deg); }
}

/* Spectrophotometer-inspired gradients */
.spectro-gradient {
    background: linear-gradient(90deg,
        #FF0000 0%,
        #FF4500 12%,
        #FFA500 24%,
        #FFFF00 36%,
        #9AFF9A 48%,
        #00FFFF 60%,
        #0080FF 72%,
        #4169E1 84%,
        #8A2BE2 96%,
        #FF1493 100%
    );
    height: 8px;
    border-radius: 4px;
    margin: 10px 0;
    position: relative;
    overflow: hidden;
}

.spectro-gradient::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: spectroScan 3s linear infinite;
}

@keyframes spectroScan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Enhanced demo cards for scientific precision */
.demo-card.precision-theme {
    border: 2px solid var(--precision-orange);
    background: linear-gradient(135deg, 
        rgba(44, 62, 80, 0.02) 0%, 
        rgba(0, 169, 224, 0.05) 100%);
}

.demo-card.precision-theme .demo-title {
    color: var(--precision-dark);
    font-family: 'Source Code Pro', monospace;
    font-weight: 600;
}

.demo-card.precision-theme .demo-type-badge {
    background: var(--scientific-cyan);
    color: var(--precision-white);
}

/* Callout enhancements for measurement theme */
.callout.measurement-tip {
    border-left: 4px solid var(--digital-green);
    background: linear-gradient(135deg, 
        rgba(0, 255, 136, 0.05) 0%, 
        rgba(0, 255, 136, 0.1) 100%);
}

.callout.precision-warning {
    border-left: 4px solid var(--precision-orange);
    background: linear-gradient(135deg, 
        rgba(255, 107, 53, 0.05) 0%, 
        rgba(255, 107, 53, 0.1) 100%);
}

.callout.scientific-insight {
    border-left: 4px solid var(--scientific-cyan);
    background: linear-gradient(135deg, 
        rgba(0, 169, 224, 0.05) 0%, 
        rgba(0, 169, 224, 0.1) 100%);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .precision-hero::after {
        width: 120px;
        height: 90px;
        top: 30%;
        right: 5%;
    }
    
    .tolerance-scale {
        flex-direction: column;
        gap: 5px;
    }
    
    .tolerance-marker {
        border-right: none;
        border-bottom: 1px solid var(--grid-lines);
    }
    
    .tolerance-marker:last-child {
        border-bottom: none;
    }
    
    .formula-display {
        padding: 15px;
        font-size: 0.9em;
    }
}

/* Print-friendly styles */
@media print {
    .precision-hero,
    .precision-hero::before,
    .precision-hero::after {
        background: var(--precision-white) !important;
        color: var(--precision-dark) !important;
    }
    
    .delta-e-value {
        background: transparent !important;
        color: var(--precision-dark) !important;
        border: 1px solid var(--precision-dark) !important;
        text-shadow: none !important;
    }
    
    .spectro-gradient {
        background: linear-gradient(90deg, #000 0%, #666 50%, #000 100%) !important;
    }
    
    /* Disable animations in print */
    * {
        animation: none !important;
        transition: none !important;
    }
}