/* ============================================================
   BONNIEBYTE PC - AIRFLOW CALCULATOR STYLES
   (airflow.css)
   ============================================================ */

.section-airflow {
    background: var(--bb-surface);
    border: 1px solid var(--bb-border);
    border-radius: 8px;
    padding: var(--space-lg) var(--space-md);
    box-shadow: var(--bb-shadow);
}

.airflow-header p {
    max-width: 640px;
}

/* Layout */
.airflow-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.airflow-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.1fr);
    gap: 28px;
    align-items: flex-start;
}

/* Mode toggle */
.airflow-mode-toggle {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px;
    background: var(--bb-panel);
    border: 1px solid var(--bb-border);
    margin-bottom: 8px;
}

.airflow-mode-btn {
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 999px;
    color: var(--bb-text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    transition: 0.2s ease;
}

.airflow-mode-btn.active {
    background: var(--bb-blue);
    color: #fff;
}

/* Panels */
.airflow-controls {
    background: var(--bb-panel);
    border-radius: 10px;
    border: 1px solid var(--bb-border);
    padding: 18px 18px 20px;
}

.airflow-panel {
    display: none;
}

.airflow-panel.active {
    display: block;
}

.af-field {
    margin-bottom: 14px;
}

.af-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--bb-text);
}

.af-field input,
.af-field select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--bb-border);
    background: #0b0b0b;
    color: var(--bb-text);
    font-size: 0.95rem;
}

html[data-theme="light"] .af-field input,
html[data-theme="light"] .af-field select {
    background: #fff;
    color: #000;
}

.af-field-inline {
    display: flex;
    gap: 10px;
}

.af-field-inline > div {
    flex: 1;
}

.af-help {
    font-size: 0.8rem;
    color: var(--bb-text-muted);
    margin-top: 3px;
}

.af-recalc-btn {
    margin-top: 6px;
    width: 100%;
}

/* Summary box */
.af-summary {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--bb-border);
    font-size: 0.95rem;
}

.af-summary h3 {
    margin-bottom: 6px;
}

#af-pressure-label,
#af-pressure-pill {
    font-weight: 700;
}

/* Visual area */
.airflow-visual {
    background: var(--bb-panel);
    border-radius: 10px;
    border: 1px solid var(--bb-border);
    padding: 18px;
}

.af-case-wrapper {
    display: flex;
    justify-content: center;
    margin: 10px 0 14px;
}

.af-case {
    position: relative;
    width: 260px;
    height: 360px;
    border-radius: 14px;
    border: 2px solid var(--bb-border);
    background: radial-gradient(circle at 30% 20%, #1b1b1b, #080808);
    overflow: hidden;
    box-shadow: 0 0 24px rgba(0,0,0,0.6);
}

/* Case zones */
.af-zone {
    position: absolute;
    pointer-events: none;
}

.af-case-front {
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.af-case-back {
    right: 0;
    top: 20%;
    bottom: 20%;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.af-case-top {
    left: 20%;
    right: 20%;
    top: 0;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.af-case-bottom {
    left: 20%;
    right: 20%;
    bottom: 0;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.af-fan-stack {
    display: flex;
    gap: 4px;
}

/* Fan icons */
.af-fan {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #222;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 30% 30%, #444, #111);
    box-shadow: 0 0 6px rgba(0,0,0,0.7);
}

.af-fan::before {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    box-sizing: border-box;
}

.af-fan.af-intake {
    box-shadow: 0 0 10px rgba(80,160,255,0.7);
}

.af-fan.af-exhaust {
    box-shadow: 0 0 10px rgba(255,110,110,0.7);
}

/* Flow lines */
.af-flow-layer {
    position: absolute;
    inset: 12%;
    pointer-events: none;
}

.af-flow-line {
    position: absolute;
    width: 180%;
    height: 3px;
    border-radius: 999px;
    opacity: 0.0;
    filter: blur(1px);
}

.af-flow-intake {
    left: -60%;
    top: 30%;
    background: linear-gradient(90deg, rgba(80,160,255,0) 0%, rgba(80,160,255,0.9) 50%, rgba(80,160,255,0) 100%);
    animation: af-flow-right 2.2s linear infinite;
}

.af-flow-exhaust {
    right: -60%;
    bottom: 30%;
    background: linear-gradient(90deg, rgba(255,120,120,0) 0%, rgba(255,120,120,0.9) 50%, rgba(255,120,120,0) 100%);
    animation: af-flow-left 2.2s linear infinite;
}

@keyframes af-flow-right {
    from { transform: translateX(0); }
    to   { transform: translateX(40%); }
}

@keyframes af-flow-left {
    from { transform: translateX(0); }
    to   { transform: translateX(-40%); }
}

/* Pressure indicator */
.af-case-centre {
    position: absolute;
    inset: 26%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    pointer-events: none;
}

.af-pressure-indicator {
    margin-bottom: 6px;
}

#af-pressure-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
}

/* Pressure states */
.af-case.af-pressure-positive {
    box-shadow: 0 0 24px rgba(80,200,255,0.5);
}

.af-case.af-pressure-positive #af-pressure-pill {
    background: rgba(80,200,255,0.15);
    border: 1px solid rgba(80,200,255,0.8);
    color: #bde8ff;
}

.af-case.af-pressure-neutral {
    box-shadow: 0 0 24px rgba(170,170,170,0.4);
}

.af-case.af-pressure-neutral #af-pressure-pill {
    background: rgba(200,200,200,0.12);
    border: 1px solid rgba(220,220,220,0.8);
    color: #e5e5e5;
}

.af-case.af-pressure-negative {
    box-shadow: 0 0 24px rgba(255,120,120,0.5);
}

.af-case.af-pressure-negative #af-pressure-pill {
    background: rgba(255,120,120,0.15);
    border: 1px solid rgba(255,150,150,0.9);
    color: #ffd3d3;
}

.af-case-note {
    font-size: 0.75rem;
    color: var(--bb-text-muted);
}

/* Legend */
.af-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 0.85rem;
    margin-top: 4px;
}

.af-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.af-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
}

.af-sw-intake {
    background: linear-gradient(90deg, rgba(80,160,255,0.1), rgba(80,160,255,0.9));
}

.af-sw-exhaust {
    background: linear-gradient(90deg, rgba(255,120,120,0.1), rgba(255,120,120,0.9));
}

.af-sw-positive {
    background: linear-gradient(90deg, rgba(80,200,255,0.1), rgba(80,200,255,0.9));
}

.af-sw-negative {
    background: linear-gradient(90deg, rgba(255,120,120,0.1), rgba(255,120,120,0.9));
}

/* Footer note */
.airflow-footer-note {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--bb-text-muted);
}

/* Responsive */
@media (max-width: 900px) {
    .airflow-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .af-case {
        transform: scale(0.9);
    }
}
