/* === Guida Respirazione - Unified Styles === */

/* Colore tematico: blu profondo */
h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.5rem;
}

/* Breath Diagram (Inspirazione/Espirazione) */
.breath-diagram {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.breath-phase {
    background: #f0f5fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #c0d4e8;
    text-align: center;
}

.breath-phase h4 {
    color: #2563eb;
    font-size: 1.3em;
    margin-bottom: 15px;
}

/* Gas Exchange Grid */
.gas-exchange {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.gas-box {
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid;
    background: var(--card-bg);
}

.gas-box.oxygen {
    border-color: #93b8e0;
    background: #f0f5fa;
}

.gas-box.co2 {
    border-color: #e0c870;
    background: #faf5e6;
}

/* System Grid (Simpatico / Parasimpatico) */
.system-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.system-box {
    color: white;
    padding: 20px;
    border-radius: 10px;
}

.sympathetic {
    background: linear-gradient(135deg, #c0564a 0%, #a84a44 100%);
}

.parasympathetic {
    background: linear-gradient(135deg, #4a8a6a 0%, #3a7a5a 100%);
}

.system-title {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.effect-list {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 15px;
}

.effect-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
}

.effect-item:last-child {
    border-bottom: none;
}

.effect-label {
    font-weight: 600;
    min-width: 140px;
}

/* Highlight Boxes */
.highlight-box {
    background: #f0f5fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid var(--accent-color);
}

.key-point {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* Cycle Diagram (Ansia / Panico) */
.cycle-step {
    display: flex;
    align-items: center;
    background: #fdf0ee;
    border-left: 4px solid #b94a3a;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 0;
}

.step-number {
    background: #b94a3a;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.arrow {
    text-align: center;
    font-size: 1.5rem;
    color: #b94a3a;
    margin: 5px 0;
}

/* Chakra Grid */
.chakra-breath {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.chakra-item {
    text-align: center;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.chakra-desc {
    font-size: 0.9em;
    margin-top: 5px;
}

.chakra-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 auto 10px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Gas box inner elements */
.gas-box hr.oxygen-divider {
    margin: 15px 0;
    border: 1px solid #93b8e0;
}

.gas-box hr.co2-divider {
    margin: 15px 0;
    border: 1px solid #e0c870;
}

.gas-box .gas-detail {
    text-align: left;
    font-size: 0.9em;
}

/* System box inner elements */
.system-box .system-subtitle {
    margin-bottom: 20px;
    font-size: 1.1em;
}

.system-box .highlight-box {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.sympathetic .highlight-box {
    border-left: 4px solid #8a3a30;
}

.parasympathetic .highlight-box {
    border-left: 4px solid #2a6a4a;
}

.sympathetic .key-point {
    color: #8a3a30;
}

.parasympathetic .key-point {
    color: #2a6a4a;
}

.system-box .system-extra {
    margin-top: 15px;
    font-size: 0.95em;
}

/* Section heading variants */
.section-heading {
    margin-top: 30px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
}

.section-heading--first {
    margin-top: 10px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
}

/* Ansia section */
.section-danger-title {
    color: #b94a3a;
    border-color: #b94a3a;
}

.cycle-step--panic {
    background: #fce8e4;
    border-color: #b94a3a;
}

.cycle-step--panic .step-number {
    background: #b94a3a;
}

.arrow--large {
    font-size: 2.5em;
    color: #b94a3a;
}

.cycle-step .cycle-list {
    margin: 5px 0 0 20px;
}

/* Vagus nerve grid */
.vagus-grid {
    display: grid;
    gap: 10px;
    margin-top: 15px;
}

.vagus-item {
    background: var(--bg-hover);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
}

.vagus-item--accent {
    background: #f0f5fa;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    border-left: 4px solid var(--accent-color);
}

.vagus-icon {
    font-size: 1.5em;
    margin-right: 15px;
}

/* Polyvagal hierarchy */
.polyvagal-hierarchy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin: 1.5rem 0;
}

.polyvagal-level {
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
    padding: 1rem 1.2rem;
    border-radius: 10px;
    gap: 1rem;
}

.polyvagal-level-label {
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    min-width: 120px;
    text-align: center;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.25);
}

.polyvagal-level-content {
    font-size: 0.95rem;
}

.polyvagal-level--ventral {
    background: #e8f4ea;
    border-left: 5px solid #3a8a50;
    color: #1a4a28;
}

.polyvagal-level--sympathetic {
    background: #fdf5ea;
    border-left: 5px solid #d0a030;
    color: #6a4a10;
}

.polyvagal-level--dorsal {
    background: #fce8e4;
    border-left: 5px solid #b94a3a;
    color: #5a2020;
}

.polyvagal-arrow {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1;
    padding: 2px 0;
}

[data-theme="dark"] .polyvagal-level--ventral {
    background: #1a2a20;
    border-left-color: #3a8a50;
    color: #8abf9a;
}

[data-theme="dark"] .polyvagal-level--sympathetic {
    background: #2a2418;
    border-left-color: #d0a030;
    color: #d0b060;
}

[data-theme="dark"] .polyvagal-level--dorsal {
    background: #2a1a18;
    border-left-color: #b94a3a;
    color: #d0908a;
}

[data-theme="dark"] .polyvagal-arrow {
    color: var(--text-secondary);
}

/* Interactive breath section */
.breath-quote {
    font-size: 1.1em;
    margin-top: 20px;
}

.breath-subquote {
    margin-top: 15px;
    font-size: 0.9em;
    font-style: italic;
}

/* Interactive Breath Circle */
.interactive-breath {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #4a5a8a 0%, #5a4a7a 100%);
    border-radius: 12px;
    color: white;
}

.breath-circle {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: breathe 4s infinite ease-in-out;
    border: 2px solid white;
}

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

/* Utility: indent list */
.indent-list {
    margin-left: 20px;
}

/* === Effetto Bohr Section === */

/* Dissociation Curve */
.bohr-curve-container {
    margin: 25px 0;
}

.bohr-curve-diagram {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 25px 20px 15px;
    position: relative;
}

.curve-y-label {
    position: absolute;
    left: -5px;
    top: 50%;
    transform: rotate(-90deg) translateX(-50%);
    transform-origin: left center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.curve-x-label {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 8px;
}

.curve-area {
    margin-left: 40px;
    position: relative;
    border-left: 2px solid var(--text-color);
    border-bottom: 2px solid var(--text-color);
    padding: 10px 10px 0;
    min-height: 220px;
}

.curve-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.curve-grid .grid-line {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px dashed var(--border-light);
}

.curve-grid .grid-line span {
    position: absolute;
    left: -35px;
    top: -10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.curve-svg {
    width: 100%;
    height: 200px;
    display: block;
}

.curve-legend {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.legend-line {
    display: inline-block;
    width: 30px;
    height: 3px;
    flex-shrink: 0;
}

.legend-line--left {
    background: #2563eb;
    background: repeating-linear-gradient(90deg, #2563eb 0, #2563eb 8px, transparent 8px, transparent 12px);
}

.legend-line--normal {
    background: var(--primary-color);
}

.legend-line--right {
    background: #b94a3a;
    background: repeating-linear-gradient(90deg, #b94a3a 0, #b94a3a 8px, transparent 8px, transparent 12px);
}

/* Shift Grid (Right/Left comparison) */
.bohr-shift-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.bohr-shift-box {
    border-radius: 10px;
    padding: 22px;
    border: 1px solid;
}

.bohr-shift--right {
    background: #fdf0ee;
    border-color: #d0a09a;
}

.bohr-shift--left {
    background: #f0f5fa;
    border-color: #a0bcd8;
}

.bohr-shift-header {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.bohr-shift--right .bohr-shift-header {
    color: #8a3a30;
}

.bohr-shift--left .bohr-shift-header {
    color: #2a5a8a;
}

.bohr-shift-icon {
    font-size: 1.4rem;
}

.bohr-shift-subtitle {
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.bohr-shift-cause {
    background: rgba(255, 255, 255, 0.6);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.bohr-shift-cause ul {
    margin: 6px 0 0;
}

.bohr-shift-result {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.bohr-shift-result--good {
    background: #e8f4ea;
    color: #1a4a28;
}

.bohr-shift-result--bad {
    background: #fdf5ea;
    color: #6a4a10;
}

.bohr-shift-when {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Paradox Steps */
.bohr-paradox {
    margin: 20px 0;
}

.paradox-step {
    display: flex;
    align-items: center;
    background: var(--bg-hover);
    border-left: 4px solid #c07050;
    padding: 16px;
    border-radius: 8px;
}

.paradox-step--result {
    background: #fdf0ee;
    border-left-color: #b94a3a;
    border-width: 4px;
}

.paradox-number {
    background: #c07050;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    margin-right: 14px;
    flex-shrink: 0;
}

.paradox-step--result .paradox-number {
    background: #b94a3a;
}

.paradox-content p {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.paradox-arrow {
    text-align: center;
    font-size: 1.3rem;
    color: #c07050;
    margin: 4px 0;
}

/* Equation Box */
.bohr-equation {
    margin: 20px 0;
}

.equation-box {
    background: linear-gradient(135deg, var(--bg-hover) 0%, #f0ebe2 100%);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 22px;
    text-align: center;
}

.equation-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.equation-formula {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
    margin: 12px 0;
}

.equation-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 10px auto 0;
}

/* Practice Cards Grid */
.bohr-practice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 18px;
    margin: 20px 0;
}

.bohr-practice-card {
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid;
}

.bohr-practice-card h4 {
    margin-bottom: 10px;
}

.bohr-practice-card p {
    font-size: 0.92rem;
    margin-bottom: 10px;
}

.bohr-practice-card ul {
    font-size: 0.88rem;
    margin: 0;
}

.bohr-practice--buteyko {
    background: #edf5ef;
    border-color: var(--success-color);
}

.bohr-practice--kumbhaka {
    background: #fdf5ea;
    border-color: var(--warning-color);
}

.bohr-practice--coherent {
    background: #f0f5fa;
    border-color: #2563eb;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 1.6rem;
    }

    .system-grid,
    .gas-exchange,
    .breath-diagram {
        grid-template-columns: 1fr;
    }

    .system-title {
        font-size: 1.2rem;
    }

    .effect-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .effect-label {
        min-width: auto;
    }

    .cycle-step {
        padding: 14px;
    }

    .step-number {
        width: 26px;
        height: 26px;
        font-size: 0.85rem;
        margin-right: 10px;
    }

    .chakra-breath {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 10px;
    }

    .chakra-item {
        padding: 8px;
        font-size: 0.85rem;
    }

    .vagus-item,
    .vagus-item--accent {
        flex-direction: column;
        text-align: center;
    }

    .vagus-icon {
        margin-right: 0;
        margin-bottom: 8px;
    }

    /* Bohr Effect responsive */
    .bohr-shift-grid,
    .bohr-practice-grid {
        grid-template-columns: 1fr;
    }

    .curve-area {
        margin-left: 30px;
    }

    .curve-legend {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .equation-formula {
        font-size: 1.1rem;
    }

    .bohr-shift-header {
        font-size: 1rem;
    }

    .paradox-step {
        padding: 12px;
    }

    .paradox-number {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
        margin-right: 10px;
    }

    .interactive-breath {
        padding: 20px 16px;
    }
}

@media (max-width: 400px) {
    h1 {
        font-size: 1.3rem;
    }

    .chakra-breath {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ================================================================
   Dark Mode — Guida Respirazione
   ================================================================ */

[data-theme="dark"] .breath-phase {
    background: #1a1e28;
    border-color: #2a4060;
}

[data-theme="dark"] .breath-phase h4 {
    color: #6a9ad0;
}

[data-theme="dark"] .gas-box {
    background: var(--card-bg);
}

[data-theme="dark"] .gas-box.oxygen {
    background: #1a1e28;
    border-color: #2a4060;
}

[data-theme="dark"] .gas-box.co2 {
    background: #2a2418;
    border-color: #4a3a20;
}

[data-theme="dark"] .highlight-box {
    background: #1a1e28;
}

[data-theme="dark"] .cycle-step {
    background: #2a1a18;
}

[data-theme="dark"] .cycle-step--panic {
    background: #2a1a18;
    border-color: #b94a3a;
}

[data-theme="dark"] .chakra-item {
    background: var(--card-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .chakra-desc {
    color: var(--text-secondary);
}

[data-theme="dark"] .section-heading,
[data-theme="dark"] .section-heading--first {
    border-bottom-color: var(--border-light);
}

[data-theme="dark"] .vagus-item {
    background: var(--bg-hover);
}

[data-theme="dark"] .vagus-item--accent {
    background: #1a1e28;
}

[data-theme="dark"] .bohr-curve-diagram {
    background: var(--card-bg);
    border-color: var(--border-light);
}

[data-theme="dark"] .curve-area {
    border-left-color: var(--text-secondary);
    border-bottom-color: var(--text-secondary);
}

[data-theme="dark"] .bohr-shift--right {
    background: #2a1a18;
    border-color: #5a3030;
}

[data-theme="dark"] .bohr-shift--left {
    background: #1a1e28;
    border-color: #2a3a50;
}

[data-theme="dark"] .bohr-shift--right .bohr-shift-header {
    color: #d0908a;
}

[data-theme="dark"] .bohr-shift--left .bohr-shift-header {
    color: #6a9ad0;
}

[data-theme="dark"] .bohr-shift-when {
    color: var(--text-secondary);
}

[data-theme="dark"] .bohr-shift-result--good {
    background: #1a2a20;
    color: #7abf8a;
}

[data-theme="dark"] .bohr-shift-result--bad {
    background: #2a2418;
    color: #d0a060;
}

[data-theme="dark"] .bohr-shift-cause {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .paradox-step {
    background: var(--bg-hover);
}

[data-theme="dark"] .paradox-step--result {
    background: #2a1a18;
}

[data-theme="dark"] .paradox-content p {
    color: var(--text-secondary);
}

[data-theme="dark"] .equation-box {
    background: linear-gradient(135deg, var(--bg-hover) 0%, #1e1c18 100%);
    border-color: var(--border-light);
}

[data-theme="dark"] .equation-label,
[data-theme="dark"] .equation-desc {
    color: var(--text-secondary);
}

[data-theme="dark"] .bohr-practice--buteyko {
    background: #1a2a20;
    border-color: var(--success-color);
}

[data-theme="dark"] .bohr-practice--kumbhaka {
    background: #2a2418;
    border-color: var(--warning-color);
}

[data-theme="dark"] .bohr-practice--coherent {
    background: #1a1e28;
    border-color: #2563eb;
}

[data-theme="dark"] .section-danger-title {
    color: #d0908a;
    border-color: #d0908a;
}

[data-theme="dark"] .arrow,
[data-theme="dark"] .arrow--large {
    color: #d0908a;
}

[data-theme="dark"] .system-box .highlight-box {
    color: #c8c4be;
}

[data-theme="dark"] .system-box .highlight-box p {
    color: #c8c4be;
}

[data-theme="dark"] .sympathetic .key-point {
    color: #d0908a;
}

[data-theme="dark"] .parasympathetic .key-point {
    color: #7abf8a;
}
