/* chapters-shared.css */

/* Design Tokens */
:root {
    --text-primary: #000000;
    --text-secondary: #64748b;
    --card-bg: #ffffff;
    --border-color: rgba(0, 0, 0, 0.1);
    --accent-marine: #1a3a5c;
    /* Marine navy - primary accent */
    --accent-marine-light: rgba(26, 58, 92, 0.07);
    /* Very subtle tint for boxes */
    --accent-marine-mid: rgba(26, 58, 92, 0.12);
    /* Slightly stronger tint */
    --accent-blue: #1a3a5c;
    /* Keep alias for backwards compat */
    --accent-blue-light: rgba(26, 58, 92, 0.07);
    --accent-green: #27ae60;
    --accent-red: #eb3349;
    --accent-orange: #f2994a;
    --font-display: 'Space Grotesk', sans-serif;
    --font-sans: 'Inter', sans-serif;
}

/* Effect Links Marine Blue Hover */
.effectLinks:hover {
    background-color: #1a3a5c !important;
    color: #ffffff !important;
}

[data-theme="dark"] .effectLinks:hover {
    background-color: #4a7fa8 !important;
    color: #ffffff !important;
}

/* ------------------------------------------------------------
   EffectLinks (global)
   Ensure consistent marine palette across the whole book, even
   when links are not wrapped in .chapter-links-inline/block or
   .quiz-links-section.
   ------------------------------------------------------------ */
.effectLinks {
    display: block !important;
    width: 100% !important;
    background: #d5dde6 !important;
    color: #1a3a5c !important;
    margin-bottom: 14px !important;
    padding: 24px 22px !important;
    min-height: 56px !important;
    line-height: 1.35;
    font-style: normal;
}

.effectLinks::after {
    background: #1a3a5c !important;
    color: #ffffff !important;
    padding: 24px 22px !important;
    pointer-events: none !important;
}

.effectLinks:hover {
    background: #1a3a5c !important;
    color: #ffffff !important;
}

/* Dark theme: keep hover accent a bit lighter */
[data-theme="dark"] .effectLinks:hover {
    background: #4a7fa8 !important;
    color: #ffffff !important;
}

/* Quiz link section at chapter bottoms */
.quiz-links-wrap {
    margin-left: 200px;
    transition: margin-left 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

@media (min-width: 992px) {
    .quiz-links-wrap {
        margin-left: 380px;
    }
}

/* Follow the same sidebar-open shift as .content */
.content.sidebar-open ~ .quiz-links-wrap {
    margin-left: 300px;
}

.quiz-links-section {
    margin-top: 3.5rem;
    margin-bottom: 3.5rem;
}

.quiz-links-section h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700 !important;
    font-style: normal;
    text-align: left;
    letter-spacing: -0.02em;
    font-size: 2.5rem;
    margin-top: 2em;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

/* EffectLinks in chapter link blocks - same look everywhere (quiz, intro, after figures) */
.quiz-links-section .effectLinks,
.chapter-links-block .effectLinks,
.chapter-links-inline .effectLinks {
    display: block !important;
    width: 100% !important;
    background: #d5dde6 !important;
    color: #1a3a5c !important;
    margin-bottom: 14px !important;
    padding: 24px 22px !important;
    min-height: 56px !important;
    line-height: 1.35;
    font-style: normal;
}

.quiz-links-section .effectLinks::after,
.chapter-links-block .effectLinks::after,
.chapter-links-inline .effectLinks::after {
    background: #1a3a5c !important;
    color: #ffffff !important;
    padding: 24px 22px !important;
    pointer-events: none !important;
}

.quiz-links-section .effectLinks:hover,
.chapter-links-block .effectLinks:hover,
.chapter-links-inline .effectLinks:hover {
    background: #1a3a5c !important;
    color: #ffffff !important;
}

/* Download links: samme look, ingen ::after overlay (så klik virker) */
.effectLinks-download::after {
    display: none !important;
}

/* Inline chapter links near introductions and reusable chapter link blocks */
.chapter-links-inline,
.chapter-links-block {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.chapter-links-title {
    /* Make sure chapter link titles always use the intended display font,
       regardless of whether they are inside .chapter-links-inline or
       .chapter-links-block. */
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.chapter-links-inline .chapter-links-title,
.chapter-links-block .chapter-links-title {
    /* Keep the selector for backwards compatibility; the base styling
       lives on .chapter-links-title now. */
}

.podcast-inline-player {
    margin: -2px 0 24px 0;
    padding: 14px 16px;
    border: none;
    background: #d5dde6;
}

.podcast-inline-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.podcast-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #1a3a5c;
    background: #1a3a5c;
    color: #ffffff;
    cursor: pointer;
    border-radius: 0 !important;
    box-shadow: none;
    transition: transform 160ms ease, background-color 160ms ease;
}

.podcast-icon-btn:active,
.podcast-icon-btn:focus,
.podcast-icon-btn:focus-visible {
    border-radius: 0 !important;
    outline: none;
}

.podcast-icon-btn:hover {
    transform: translateY(-1px);
}

.podcast-icon-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.podcast-play svg {
    transition: transform 180ms ease, opacity 180ms ease;
}

.podcast-play .icon-pause {
    display: none;
    opacity: 0;
}

.podcast-play.is-playing .icon-play {
    display: none;
}

.podcast-play.is-playing .icon-pause {
    display: inline;
    opacity: 1;
    animation: podcastPulse 620ms ease;
}

.podcast-speed-controls {
    display: inline-flex;
    gap: 8px;
    margin-left: auto;
    align-items: center;
}

.podcast-speed-up svg,
.podcast-speed-down svg {
    transition: transform 180ms ease;
}

.podcast-speed-up:hover svg {
    transform: scale(1.16) rotate(6deg);
}

.podcast-speed-down:hover svg {
    transform: scale(1.16) rotate(-6deg);
}

.podcast-meta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
}

.podcast-speed-label,
.podcast-time {
    font-size: 0.875rem;
    color: #1a3a5c;
    font-family: 'IBM Plex Mono', monospace;
}

.podcast-seek {
    width: 100%;
    margin: 2px 0 10px 0;
    accent-color: #1a3a5c;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: none;
    border-radius: 0 !important;
    height: 14px;
}

.podcast-seek::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 0 !important;
    border: none;
    background: linear-gradient(90deg, #1a3a5c var(--seek-percent, 0%), rgba(26, 58, 92, 0.12) var(--seek-percent, 0%));
}

.podcast-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 0 !important;
    margin-top: -5px;
    background: #1a3a5c;
    border: 1px solid #1a3a5c;
}

.podcast-seek::-moz-range-track {
    height: 6px;
    border: none;
    border-radius: 0 !important;
    background: rgba(26, 58, 92, 0.12);
}

.podcast-seek::-moz-range-progress {
    height: 6px;
    background: #1a3a5c;
}

.podcast-seek::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 1px solid #1a3a5c;
    border-radius: 0 !important;
    background: #1a3a5c;
}

.podcast-seek:focus {
    outline: none;
}

.podcast-meter {
    width: 100%;
    height: 44px;
    display: block;
    border: 1px solid rgba(26, 58, 92, 0.12);
    background: #ffffff;
}

[data-theme="dark"] .quiz-links-section .effectLinks,
[data-theme="dark"] .chapter-links-block .effectLinks,
[data-theme="dark"] .chapter-links-inline .effectLinks {
    background: rgba(74, 127, 168, 0.2) !important;
    color: #dbeafe !important;
}

[data-theme="dark"] .quiz-links-section .effectLinks::after,
[data-theme="dark"] .quiz-links-section .effectLinks:hover,
[data-theme="dark"] .chapter-links-block .effectLinks::after,
[data-theme="dark"] .chapter-links-block .effectLinks:hover,
[data-theme="dark"] .chapter-links-inline .effectLinks::after,
[data-theme="dark"] .chapter-links-inline .effectLinks:hover {
    background: #4a7fa8 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .podcast-inline-player {
    border: none;
    background: rgba(74, 127, 168, 0.2);
}

[data-theme="dark"] .podcast-icon-btn {
    border-color: #4a7fa8;
    background: #4a7fa8;
}

[data-theme="dark"] .podcast-speed-label,
[data-theme="dark"] .podcast-time {
    color: #dbeafe;
}

[data-theme="dark"] .podcast-seek {
    accent-color: #4a7fa8;
}

[data-theme="dark"] .podcast-seek::-webkit-slider-runnable-track {
    border: none;
    background: linear-gradient(90deg, #4a7fa8 var(--seek-percent, 0%), rgba(74, 127, 168, 0.22) var(--seek-percent, 0%));
}

[data-theme="dark"] .podcast-seek::-webkit-slider-thumb {
    background: #4a7fa8;
    border-color: #4a7fa8;
}

[data-theme="dark"] .podcast-seek::-moz-range-progress {
    background: #4a7fa8;
}

[data-theme="dark"] .podcast-seek::-moz-range-track {
    border: none;
    background: rgba(74, 127, 168, 0.22);
}

[data-theme="dark"] .podcast-seek::-moz-range-thumb {
    background: #4a7fa8;
    border-color: #4a7fa8;
}

.podcast-inline-player .podcast-meter {
    display: none;
}

.podcast-inline-player.has-started .podcast-meter {
    display: block;
}

[data-theme="dark"] .podcast-meter {
    border-color: rgba(74, 127, 168, 0.3);
    background: rgba(15, 23, 42, 0.6);
}

@keyframes podcastPulse {
    0% {
        transform: scale(0.84);
    }
    60% {
        transform: scale(1.09);
    }
    100% {
        transform: scale(1);
    }
}

[data-theme="dark"] {
    --text-primary: #e0e0e0;
    --text-secondary: #aaaaaa;
    --card-bg: #121212;
    --border-color: rgba(255, 255, 255, 0.15);
    --accent-marine: #4a7fa8;
    --accent-marine-light: rgba(74, 127, 168, 0.1);
    --accent-marine-mid: rgba(74, 127, 168, 0.18);
    --accent-blue: #4a7fa8;
    --accent-blue-light: rgba(74, 127, 168, 0.1);
}

/* Force completely clean tables (No white borders or lines) */
table.table {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
}

/* Dark mode table improvements: discrete lines and row shading */
[data-theme="dark"] table.table {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] table.table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] table.table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] table.table thead tr,
[data-theme="dark"] table.table thead th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.25) !important;
    background-color: rgba(255, 255, 255, 0.08);
}

/* General rule for legal-terms in dark headers (e.g. table-dark) */
.table-dark th .legal-term,
thead.table-dark th .legal-term,
.table thead[style*="background"] th .legal-term {
    color: #ffffff !important;
    border-bottom-color: rgba(255, 255, 255, 0.5) !important;
}

.table-dark th .legal-term:hover,
thead.table-dark th .legal-term:hover,
.table thead[style*="background"] th .legal-term:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-bottom-color: #ffffff !important;
}

/* Navy blue table headers — all chapters */
table.table thead th,
table.table thead tr th,
.table thead th {
    background-color: #1a3a5c !important;
    color: #ffffff !important;
}

/* Ensure legal-term links in all navy headers are white */
table.table thead th .legal-term,
.table thead th .legal-term {
    color: #ffffff !important;
    border-bottom-color: rgba(255, 255, 255, 0.5) !important;
}
table.table thead th .legal-term:hover,
.table thead th .legal-term:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-bottom-color: #ffffff !important;
}

table.table th,
table.table td,
table.table tr,
table.table thead,
table.table tbody {
    border: none !important;
}

table.table-bordered {
    border: none !important;
}

/* Tabel 5.6 — ingen scroll, sidste søjle får mest plads */
.table-wrapper-56 {
    overflow: visible;
    max-width: 100%;
}
.table-56 {
    width: 100% !important;
    table-layout: fixed;
    font-size: 0.9rem;
}
.table-56 th,
.table-56 td {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    padding: 0.6rem 0.6rem;
    vertical-align: top;
}
.table-56 th:last-child,
.table-56 td:last-child {
    min-width: 0;
    width: 45%;
}
.table-56 thead th {
    font-weight: 600;
    line-height: 1.3;
    /* Override global rule in css/styles.css: .content table th { white-space: nowrap; } */
    white-space: normal !important;
    word-break: break-word;
    hyphens: auto;
    color: #ffffff !important;
}
.table-56 tbody td {
    line-height: 1.4;
}
.table-56 tbody tr:hover td {
    background-color: var(--accent-marine-light);
}

/* Stat Cards & Numbers */
.stat-card {
    background: var(--card-bg);
    border-radius: 0 !important;
    padding: 24px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    font-family: var(--font-display);
    line-height: 1.2;
    margin-bottom: 5px;
    color: var(--text-primary) !important;
    /* Ensure numbers are never colored */
}

/* Remove colored accents from numbers specifically */
.stat-number.accent-purple,
.stat-number.accent-green,
.stat-number.accent-orange,
.stat-number.accent-blue {
    color: var(--text-primary) !important;
}

.stat-label {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 500;
    line-height: 1.4;
}

/* Info Box Base */
.info-box {
    background-color: var(--card-bg);
    padding: 25px;
    margin: 20px 0;
    border-radius: 0 !important;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

/* Chart Containers */
.chart-container {
    position: relative;
    width: 100%;
    border-radius: 0 !important;
    padding: 15px;
    margin: 20px 0;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chart-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

:root:not([data-theme="dark"]) .chart-container {
    background-color: var(--card-bg);
}

[data-theme="dark"] .chart-container {
    background-color: #000000;
}

.chart-container.borderless {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding-left: 0;
    padding-right: 0;
}

.info-box.borderless,
.stat-card.borderless {
    border: none;
    box-shadow: none !important;
    background: transparent;
    padding: 15px;
    /* Restored padding for text content */
}

.chart-container.wide {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.chart-container.square {
    aspect-ratio: 1 / 1;
}

/* Map specific fixes */
.leaflet-container {
    background: transparent !important;
    font-family: inherit;
    z-index: 1;
}

[data-theme="dark"] .leaflet-tile {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

.leaflet-tooltip {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    padding: 10px !important;
    pointer-events: none;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

/* Reveal on Scroll */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Legal Terms styling moved to glossary.css */

/* Simulation / Case Cards */
.simulation-card {
    border-radius: 0 !important;
    border: 1px solid var(--border-color) !important;
    border-left: 5px solid var(--accent-marine) !important;
    background-color: var(--accent-marine-light);
    color: var(--text-primary);
    padding: 28px 30px !important;
    text-align: left;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
    margin: 2rem 0;
}

.simulation-btn {
    background: var(--accent-marine) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 0 !important;
    letter-spacing: 1px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 10px 24px !important;
    transition: all 0.25s ease;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.simulation-btn:hover {
    background: #0d2540 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(26, 58, 92, 0.35);
    color: #ffffff !important;
    text-decoration: none;
}

/* Specific for circular pillars (if used) */
.credit-pillar {
    text-align: center;
    padding: 30px 20px;
    border: 2px solid var(--accent-marine);
    border-radius: 50%;
    width: 180px;
    height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    background: var(--accent-marine-light);
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--accent-marine);
    transition: all 0.3s ease;
}

.credit-pillar:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(26, 58, 92, 0.2);
}

/* Calculation blocks — brand-consistent highlight for formulas/numbers */
.calc-block {
    background-color: var(--accent-marine-light);
    border-radius: 0 !important;
    padding: 12px 16px;
    margin: 8px 0 16px 0;
    font-family: Consolas, monospace;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.calc-block.calc-emphasis {
    border-left: 5px solid var(--accent-marine) !important;
}

/* Example / regneksempel boxes — match tip-box style */
.border-left-navy,
.stat-card.bg-light,
.stat-card.border-left-navy,
.example-box {
    background-color: rgba(26, 58, 92, 0.05) !important;
    border: 1px solid rgba(26, 58, 92, 0.15) !important;
    border-left: 5px solid #1a3a5c !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    text-align: left !important;
}

[data-theme="dark"] .border-left-navy,
[data-theme="dark"] .stat-card.bg-light,
[data-theme="dark"] .stat-card.border-left-navy,
[data-theme="dark"] .example-box {
    background-color: rgba(74, 127, 168, 0.1) !important;
    border-color: rgba(74, 127, 168, 0.3) !important;
    border-left-color: #4a7fa8 !important;
}

/* Tip Boxes — identical look to simulation-card */
.tip-box {
    border-radius: 0 !important;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--accent-marine);
    background-color: var(--accent-marine-light);
    padding: 20px 24px;
    margin: 20px 0;
    font-size: 0.95rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .tip-box {
    background-color: var(--accent-marine-light);
}

/* iframe Containers */
.iframe-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    margin: 20px 0;
}

[data-theme="dark"] .iframe-container {
    background: #000000;
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border: none;
}

[data-theme="dark"] .credit-pillar {
    border-color: var(--accent-green);
    background: rgba(39, 174, 96, 0.1);
    color: var(--accent-green);
}

.credit-pillar-sub {
    font-size: 0.8rem;
    font-weight: 400;
    margin-top: 5px;
    color: var(--text-secondary);
}

/* Response Tables */
.comparison-table .check {
    color: var(--accent-green);
}

.comparison-table .cross {
    color: var(--accent-red);
}

/* Tax Calculator */
.tax-calculator {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0 !important;
    padding: 30px;
    margin: 20px 0;
    transition: box-shadow 0.3s ease;
}

.tax-calculator:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.tax-calculator input[type="range"] {
    width: 100%;
    margin: 15px 0;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 0;
    background: #e9ecef;
    background-image: linear-gradient(90deg, #11998e, #667eea, #764ba2);
    background-repeat: no-repeat;
    outline: none;
}

.tax-calculator input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.calc-result {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-green);
}

/* Chart Loading & Utilities */
.chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.chart-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

canvas {
    border-radius: 0 !important;
}

/* Icon Animations */
.info-box i.bi,
.icon-animated {
    display: inline-block;
    transform-origin: 50% 55%;
    will-change: transform, filter;
    transform: translateZ(0);
    transition: transform 260ms ease, filter 260ms ease, opacity 260ms ease, color 260ms ease;
    animation: icon-gentle 3.8s ease-in-out infinite;
    animation-delay: var(--icon-delay, 0s);
    opacity: 0.96;
}

.tip-box:hover i.bi,
.tip-box:focus-within i.bi,
.tip-box:hover .icon-animated,
.tip-box:focus-within .icon-animated {
    animation-play-state: paused;
    transform: translateY(-2px) scale(1.06) rotate(-3deg);
    opacity: 1;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.12));
}

.navbar i.bi,
.sidebar i.bi {
    display: inline-block;
    transform-origin: 50% 55%;
    will-change: transform, filter;
    transition: transform 220ms ease, filter 220ms ease, opacity 220ms ease;
    opacity: 0.9;
}

.navbar .nav-link:hover i.bi,
.navbar .nav-link:focus-visible i.bi,
.sidebar button:hover i.bi,
.sidebar button:focus-visible i.bi {
    transform: translateY(-1px) scale(1.08) rotate(-4deg);
    opacity: 1;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.12));
}

.navbar .nav-link:hover .bi-arrow-left,
.navbar .nav-link:focus-visible .bi-arrow-left {
    transform: translateX(-2px) translateY(-1px) scale(1.08);
}

.navbar .nav-link:hover .bi-arrow-right,
.navbar .nav-link:focus-visible .bi-arrow-right {
    transform: translateX(2px) translateY(-1px) scale(1.08);
}

/* Subtle staggering for concept tip-boxes */
.mt-4 > .tip-box:nth-of-type(1) h5 > i.bi { --icon-delay: 0s; }
.mt-4 > .tip-box:nth-of-type(2) h5 > i.bi { --icon-delay: -0.7s; }
.mt-4 > .tip-box:nth-of-type(3) h5 > i.bi { --icon-delay: -1.4s; }
.mt-4 > .tip-box:nth-of-type(4) h5 > i.bi { --icon-delay: -2.1s; }

@keyframes icon-gentle {
    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    35% {
        transform: translateY(-3px) rotate(-1.8deg) scale(1.04);
    }

    65% {
        transform: translateY(1px) rotate(1.2deg) scale(0.99);
    }
}

.tip-box:hover .bi-arrow-repeat,
.tip-box:focus-within .bi-arrow-repeat {
    transform: translateY(-2px) scale(1.06) rotate(12deg);
}

/* Make the four concept icons clearly, but still discreetly, animated */
.tip-box h5 .bi-clock-history {
    animation: icon-clock 3.2s ease-in-out infinite;
    color: rgba(0, 0, 0, 0.78);
}

.tip-box h5 .bi-arrow-repeat {
    animation: icon-loop 2.8s ease-in-out infinite;
}

.tip-box h5 .bi-calculator {
    animation: icon-calc 3.4s ease-in-out infinite;
}

.tip-box h5 .bi-shield-lock {
    animation: icon-shield 3.6s ease-in-out infinite;
}

@keyframes icon-clock {
    0%,
    100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-6deg) scale(1.03); }
    55% { transform: rotate(4deg) scale(1.03); }
}

@keyframes icon-loop {
    0%,
    100% { transform: rotate(0deg) scale(1); }
    45% { transform: rotate(14deg) scale(1.05); }
}

@keyframes icon-calc {
    0%,
    100% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-3px) scale(1.05); }
    70% { transform: translateY(0) scale(0.99); }
}

@keyframes icon-shield {
    0%,
    100% { transform: scale(1); }
    45% { transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .info-box i.bi,
    .icon-animated,
    .animate-padlock {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        filter: none !important;
    }

    .navbar i.bi,
    .sidebar i.bi {
        transition: none !important;
        transform: none !important;
        filter: none !important;
    }
}

.animate-padlock {
    animation: floating 4s ease-in-out infinite;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
}

.icon-circle:hover .animate-padlock {
    transform: scale(1.15) rotate(5deg);
}

@keyframes floating {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .stat-number {
        font-size: 1.8rem;
    }
}