/* Screening Techniques Article Specific Styles */

/* Enhanced Printing Technology Theme */
.printing-gradient {
    background: linear-gradient(135deg, 
        #2d3142 0%, 
        #00a9e0 25%, 
        #57cc99 50%, 
        #ff9b42 75%, 
        #ff3e8a 100%
    );
}

/* Printing badge enhancements */
.printing-badge {
    background: linear-gradient(135deg, #2d3142, #00a9e0);
    animation: mechanicalPulse 4s ease-in-out infinite;
}

@keyframes mechanicalPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 169, 224, 0.3);
    }
    50% { 
        transform: scale(1.03);
        box-shadow: 0 0 25px 15px rgba(0, 169, 224, 0.1);
    }
}

/* Printing pattern background animation */
.printing-pattern {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(0, 169, 224, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255, 155, 66, 0.1) 1px, transparent 1px);
    background-size: 20px 20px, 15px 15px;
    animation: patternShift 12s linear infinite;
}

@keyframes patternShift {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 20px 20px, 15px 15px; }
}

/* Enhanced halftone-specific demo cards */
.demo-card-tool .halftone-preview {
    position: relative;
    background: radial-gradient(circle at 50% 50%, 
        rgba(45, 49, 66, 0.8) 30%, 
        transparent 30%);
    background-size: 8px 8px;
    animation: halftoneRotate 8s linear infinite;
}

@keyframes halftoneRotate {
    0% { transform: rotate(0deg); background-size: 8px 8px; }
    25% { transform: rotate(15deg); background-size: 6px 6px; }
    50% { transform: rotate(45deg); background-size: 10px 10px; }
    75% { transform: rotate(75deg); background-size: 7px 7px; }
    100% { transform: rotate(90deg); background-size: 8px 8px; }
}

/* Pattern overlay effects for moiré demo */
.demo-card-experiment .pattern-overlay {
    position: relative;
    height: 120px;
    background: linear-gradient(135deg, 
        rgba(0, 169, 224, 0.1) 0%, 
        rgba(255, 155, 66, 0.1) 100%);
    overflow: hidden;
}

.demo-card-experiment .pattern-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(45deg, 
        rgba(45, 49, 66, 0.3) 1px, 
        transparent 1px);
    background-size: 6px 6px;
}

.demo-card-experiment .pattern-layer.pattern-1 {
    animation: patternDrift1 6s ease-in-out infinite;
}

.demo-card-experiment .pattern-layer.pattern-2 {
    animation: patternDrift2 6s ease-in-out infinite;
    background-image: linear-gradient(75deg, 
        rgba(255, 62, 138, 0.3) 1px, 
        transparent 1px);
}

@keyframes patternDrift1 {
    0%, 100% { transform: rotate(45deg) scale(1); }
    50% { transform: rotate(47deg) scale(1.1); }
}

@keyframes patternDrift2 {
    0%, 100% { transform: rotate(75deg) scale(1); }
    50% { transform: rotate(73deg) scale(0.9); }
}

/* Screen comparison enhancements */
.demo-card-comparison .am-preview {
    background: radial-gradient(circle, 
        rgba(0, 169, 224, 0.6) 40%, 
        transparent 40%);
    background-size: 12px 12px;
    animation: amPattern 3s ease-in-out infinite;
}

.demo-card-comparison .fm-preview {
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 62, 138, 0.4) 2px, transparent 2px),
        radial-gradient(circle at 70% 80%, rgba(255, 62, 138, 0.4) 1.5px, transparent 1.5px),
        radial-gradient(circle at 45% 60%, rgba(255, 62, 138, 0.4) 2.5px, transparent 2.5px),
        radial-gradient(circle at 85% 20%, rgba(255, 62, 138, 0.4) 1px, transparent 1px);
    animation: fmPattern 4s ease-in-out infinite;
}

@keyframes amPattern {
    0%, 100% { background-size: 12px 12px; }
    50% { background-size: 8px 8px; }
}

@keyframes fmPattern {
    0%, 100% { 
        background-position: 0 0, 0 0, 0 0, 0 0;
        filter: blur(0px);
    }
    50% { 
        background-position: 2px 2px, -1px 1px, 1px -1px, -2px 0px;
        filter: blur(0.5px);
    }
}

/* Rosette simulator styling */
.demo-card-simulation .rosette-pattern {
    width: 100px;
    height: 100px;
    background: 
        radial-gradient(circle at 50% 50%, rgba(0, 169, 224, 0.3) 25%, transparent 25%),
        radial-gradient(circle at 50% 50%, rgba(255, 62, 138, 0.3) 25%, transparent 25%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 0, 0.3) 25%, transparent 25%),
        radial-gradient(circle at 50% 50%, rgba(45, 49, 66, 0.4) 25%, transparent 25%);
    background-size: 16px 16px, 16px 16px, 16px 16px, 16px 16px;
    background-position: 0 0, 4px 4px, 8px 8px, 12px 12px;
    animation: rosetteFormation 6s ease-in-out infinite;
    border-radius: 50%;
    margin: 0 auto;
}

@keyframes rosetteFormation {
    0% { 
        transform: rotate(0deg);
        background-size: 16px 16px, 16px 16px, 16px 16px, 16px 16px;
    }
    25% { 
        transform: rotate(15deg);
        background-size: 14px 14px, 18px 18px, 16px 16px, 20px 20px;
    }
    50% { 
        transform: rotate(45deg);
        background-size: 12px 12px, 20px 20px, 14px 14px, 22px 22px;
    }
    75% { 
        transform: rotate(75deg);
        background-size: 18px 18px, 16px 16px, 20px 20px, 14px 14px;
    }
    100% { 
        transform: rotate(90deg);
        background-size: 16px 16px, 16px 16px, 16px 16px, 16px 16px;
    }
}

/* Color control indicators for CMYK */
.color-control.cyan {
    border-left: 4px solid #00a9e0;
}

.color-control.magenta {
    border-left: 4px solid #ff3e8a;
}

.color-control.yellow {
    border-left: 4px solid #ff9b42;
}

.color-control.black {
    border-left: 4px solid #2d3142;
}

/* Dot gain visualization */
.demo-card-standard[data-demo="dot-gain-analyzer"] .dot-visual {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.demo-card-standard[data-demo="dot-gain-analyzer"] .dot-visual.original {
    background: rgba(45, 49, 66, 0.5);
    animation: dotPulse 2s ease-in-out infinite;
}

.demo-card-standard[data-demo="dot-gain-analyzer"] .dot-visual.printed {
    background: rgba(45, 49, 66, 0.8);
    transform: scale(1.36); /* 68% vs 50% = 1.36x */
    animation: dotSpread 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.05); opacity: 0.7; }
}

@keyframes dotSpread {
    0%, 100% { transform: scale(1.36); filter: blur(0px); }
    50% { transform: scale(1.4); filter: blur(0.5px); }
}

/* Stochastic pattern generation */
.demo-card-standard[data-demo="stochastic-demo"] .generated-pattern.stochastic {
    background-image: 
        radial-gradient(circle at 12% 23%, rgba(45, 49, 66, 0.6) 1px, transparent 1px),
        radial-gradient(circle at 67% 45%, rgba(45, 49, 66, 0.6) 1.5px, transparent 1.5px),
        radial-gradient(circle at 34% 78%, rgba(45, 49, 66, 0.6) 1px, transparent 1px),
        radial-gradient(circle at 89% 12%, rgba(45, 49, 66, 0.6) 2px, transparent 2px),
        radial-gradient(circle at 45% 34%, rgba(45, 49, 66, 0.6) 1px, transparent 1px),
        radial-gradient(circle at 78% 67%, rgba(45, 49, 66, 0.6) 1.5px, transparent 1.5px),
        radial-gradient(circle at 23% 89%, rgba(45, 49, 66, 0.6) 1px, transparent 1px),
        radial-gradient(circle at 56% 12%, rgba(45, 49, 66, 0.6) 2px, transparent 2px);
    background-size: 20px 20px;
    animation: stochasticShift 8s linear infinite;
    height: 80px;
}

@keyframes stochasticShift {
    0% { background-position: 0 0; }
    100% { background-position: 20px 20px; }
}

/* Status indicators for demo results */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
    animation: statusPulse 2s ease-in-out infinite;
}

.status-dot.warning {
    background: linear-gradient(45deg, #ff9b42, #ff3e8a);
}

.status-dot.success {
    background: linear-gradient(45deg, #57cc99, #00a9e0);
}

.status-dot.error {
    background: linear-gradient(45deg, #ff3e8a, #ff9b42);
}

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

/* Enhanced technique badges */
.technique-badge {
    background: linear-gradient(135deg, 
        rgba(0, 169, 224, 0.2) 0%, 
        rgba(87, 204, 153, 0.2) 100%);
    border: 1px solid rgba(0, 169, 224, 0.3);
    color: var(--scientific-cyan);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    animation: badgeGlow 3s ease-in-out infinite;
}

@keyframes badgeGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 169, 224, 0.2); }
    50% { box-shadow: 0 0 15px 5px rgba(0, 169, 224, 0.1); }
}

/* Printing-specific callouts */
.callout-industry .callout-icon {
    background: linear-gradient(135deg, #2d3142, #00a9e0);
    color: white;
}

.callout-trend .callout-icon {
    background: linear-gradient(135deg, #00a9e0, #57cc99);
    color: white;
}

/* Enhanced formula styling for printing calculations */
.formula-container {
    background: linear-gradient(135deg, 
        rgba(45, 49, 66, 0.05) 0%, 
        rgba(0, 169, 224, 0.05) 100%);
    border: 2px solid rgba(45, 49, 66, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.formula {
    background: linear-gradient(90deg, #2d3142, #00a9e0);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    font-family: 'Source Code Pro', monospace;
    text-align: center;
    font-size: 1.1rem;
}

/* Zoom control styling */
.zoom-btn {
    background: rgba(0, 169, 224, 0.1);
    border: 1px solid rgba(0, 169, 224, 0.3);
    color: var(--scientific-cyan);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin: 0 0.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zoom-btn.active,
.zoom-btn:hover {
    background: var(--scientific-cyan);
    color: white;
    transform: translateY(-1px);
}

/* Slider controls styling */
.angle-slider,
.density-slider {
    height: 4px;
    background: linear-gradient(90deg, 
        rgba(0, 169, 224, 0.2) 0%, 
        rgba(0, 169, 224, 0.8) 50%, 
        rgba(0, 169, 224, 0.2) 100%);
    border-radius: 2px;
    position: relative;
    margin-top: 0.5rem;
}

.angle-slider::after,
.density-slider::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--scientific-cyan);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Statistical display enhancements */
.stat-value.excellent {
    color: var(--flash-green);
    font-weight: 700;
}

.stat-value.low,
.stat-value.optimal {
    color: var(--scientific-cyan);
    font-weight: 600;
}

/* Comparison divider styling */
.comparison-divider {
    background: linear-gradient(135deg, 
        rgba(255, 62, 138, 0.8) 0%, 
        rgba(255, 155, 66, 0.8) 100%);
    color: white;
    font-weight: 900;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 1rem;
    animation: dividerPulse 2s ease-in-out infinite;
}

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

/* Article-specific responsive enhancements */
@media (max-width: 768px) {
    .printing-badge {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
    
    .tutorial-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .complexity-indicator,
    .tutorial-stats {
        justify-content: center;
    }
    
    .demo-card-simulation .rosette-pattern {
        width: 60px;
        height: 60px;
    }
    
    .comparison-container {
        flex-direction: column;
        gap: 2rem;
    }
    
    .comparison-divider {
        transform: rotate(90deg);
        margin: 1rem 0;
    }
}

/* Print-specific styles for screening article */
@media print {
    .demo-card-tool::after,
    .demo-card-experiment::after,
    .demo-card-simulation::after,
    .demo-card-comparison::after,
    .demo-card-standard::after {
        content: "Interactive Demo: Visit madscientistinresidence.com to experience halftone screening demonstrations";
        display: block;
        text-align: center;
        padding: 1rem;
        background: #f0f0f0;
        border: 1px solid #ccc;
        font-style: italic;
        color: #666;
        margin-top: 1rem;
    }
    
    .printing-badge,
    .complexity-indicator,
    .demo-overlay,
    .status-dot {
        display: none !important;
    }
    
    .rosette-pattern,
    .halftone-preview,
    .pattern-overlay {
        animation: none !important;
        filter: none !important;
    }
}

/* Accessibility enhancements for printing content */
@media (prefers-reduced-motion: reduce) {
    .printing-badge,
    .printing-pattern,
    .halftone-preview,
    .pattern-layer,
    .rosette-pattern,
    .dot-visual,
    .generated-pattern {
        animation: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .printing-gradient {
        background: linear-gradient(135deg, #000080 0%, #800080 100%);
    }
    
    .formula {
        background: none;
        background-clip: unset;
        -webkit-background-clip: unset;
        -webkit-text-fill-color: unset;
        color: #000080;
    }
    
    .status-dot.warning {
        background: #ff6600;
    }
    
    .status-dot.success {
        background: #008000;
    }
    
    .status-dot.error {
        background: #cc0000;
    }
}