/* ============================================================
   Animated Scientific Explainers — DH Geo Consultancy
   Interactive SVG explainer panels (dark theme)
   ============================================================ */

.explainer-section {
    padding: 5rem 0;
    background: var(--bg-alt);
}

.explainer-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    margin-top: 2rem;
}

.explainer-svg-wrap {
    background: #060b18;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.explainer-svg {
    display: block;
    width: 100%;
    height: auto;
}

.explainer-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.explainer-btn {
    background: linear-gradient(135deg, var(--accent-orange), #f97316);
    color: #0a1120;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 999px;
    padding: 0.7rem 1.6rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.explainer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(251, 146, 60, 0.35);
}

.explainer-btn:disabled {
    opacity: 0.5;
    cursor: wait;
    transform: none;
}

.explainer-btn.secondary {
    background: var(--surface-2);
    color: var(--text-strong);
    border: 1px solid var(--border);
}

.explainer-slider-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.explainer-slider-group input[type="range"] {
    accent-color: var(--accent-orange);
    width: 180px;
}

.explainer-readout {
    margin-left: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    min-width: 200px;
}

.explainer-steps {
    margin-top: 1.5rem;
    padding-left: 1.25rem;
    color: var(--text);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem 2rem;
    counter-reset: expstep;
    list-style: none;
}

.explainer-steps li {
    counter-increment: expstep;
    position: relative;
    padding-left: 2.2rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.explainer-steps li::before {
    content: counter(expstep);
    position: absolute;
    left: 0;
    top: 0.1rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--accent-orange);
    color: var(--accent-orange);
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.explainer-steps li.active-step::before {
    background: var(--accent-orange);
    color: #0a1120;
}

.explainer-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* SVG text defaults */
.explainer-svg text {
    font-family: 'Inter', sans-serif;
}

/* Reusable SVG animation classes */
.exp-pulse {
    animation: expPulse 2s ease-in-out infinite;
}

@keyframes expPulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

.exp-dash-flow {
    stroke-dasharray: 6 8;
    animation: expDashFlow 1.2s linear infinite;
}

@keyframes expDashFlow {
    to { stroke-dashoffset: -14; }
}

.exp-hover-float {
    animation: expFloat 3s ease-in-out infinite;
}

@keyframes expFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@media (max-width: 640px) {
    .explainer-readout {
        margin-left: 0;
        width: 100%;
    }
}
