/* ==========================================
   COMPOUND INTEREST CALCULATOR
========================================== */

.compound-page{
    max-width:1100px;
    margin:auto;
    padding:60px 20px;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:35px;
}

.compound-card,
.result-card,
.compound-info{
    background:#ffffff;
    color:#1f2937;
    border-radius:24px;
    box-shadow:0 18px 45px rgba(0,0,0,.12);
    padding:35px;
}

.compound-card h1{
    color:#10b981;
    text-align:center;
    margin-bottom:10px;
}

.subtitle{
    text-align:center;
    color:#64748b;
    margin-bottom:25px;
    line-height:1.6;
}

.compound-card label{
    display:block;
    font-weight:700;
    margin-bottom:8px;
}

.compound-card input,
.compound-card select{
    width:100%;
    padding:14px 15px;
    font-size:16px;
    border-radius:14px;
    border:1px solid #d1d5db;
    outline:none;
    margin-bottom:18px;
}

.actions{
    display:flex;
    gap:12px;
}

.actions button{
    flex:1;
    border:none;
    border-radius:14px;
    padding:14px 20px;
    font-size:16px;
    font-weight:700;
    cursor:pointer;
    background:#10b981;
    color:white;
}

.reset-btn{
    background:#334155 !important;
}

.result-card h2,
.compound-info h2{
    color:#10b981;
    text-align:center;
}

.compound-result{
    min-height:220px;
    display:flex;
    justify-content:center;
    align-items:center;
    text-align:center;
    border:2px dashed #d1d5db;
    border-radius:20px;
    padding:25px;
    color:#64748b;
}

.compound-result.active{
    display:block;
    text-align:left;
}

.result-line{
    display:flex;
    justify-content:space-between;
    padding:12px 0;
    border-bottom:1px solid #e5e7eb;
    font-weight:700;
}

.result-line strong{
    color:#10b981;
}

.growth-bars{
    margin-top:25px;
}

.bar-row{
    margin-bottom:18px;
    font-weight:700;
}

.bar-row span{
    display:block;
    margin-bottom:8px;
}

.bar-bg{
    height:16px;
    background:#e5e7eb;
    border-radius:50px;
    overflow:hidden;
}

.bar{
    height:100%;
    width:0%;
    transition:width .8s ease;
}

.investment-bar{
    background:#10b981;
}

.interest-bar{
    background:#f59e0b;
}

.compound-info{
    max-width:1100px;
    margin:0 auto 40px;
    line-height:1.7;
}

/* ---------- DARK MODE ---------- */

body.dark-mode .compound-card,
body.dark-mode .result-card,
body.dark-mode .compound-info{
    background:#1f2937;
    color:#e5e7eb;
}

body.dark-mode .subtitle,
body.dark-mode .compound-result{
    color:#cbd5e1;
}

body.dark-mode .compound-card input,
body.dark-mode .compound-card select{
    background:#111827;
    color:#e5e7eb;
    border-color:#374151;
}

body.dark-mode .compound-result{
    border-color:#374151;
}

body.dark-mode .result-line{
    border-bottom-color:#374151;
}

body.dark-mode .bar-bg{
    background:#374151;
}

@media(max-width:768px){
    .compound-page{
        grid-template-columns:1fr;
        padding:35px 15px;
    }

    .actions{
        flex-direction:column;
    }
}
/* ======================================
   COMPOUND NUMBER WORDS
   ====================================== */

.compound-result-item{
    display:grid;
    grid-template-columns:
        minmax(0,1fr)
        auto;

    gap:4px 12px;
    align-items:center;
}

.compound-result-item strong{
    font-variant-numeric:
        tabular-nums;

    text-align:right;
}

.compound-number-words{
    grid-column:1 / -1;

    display:block;
    margin-top:4px;
    padding:8px 10px;

    border:
        1px solid
        var(--tool-words-border);

    border-radius:8px;

    background:
        var(--tool-words-bg);

    color:
        var(--tool-words-text);

    font-size:.76rem;
    font-weight:600;
    line-height:1.45;
    text-align:center;

    overflow-wrap:anywhere;
}

/* =========================================
   COMPOUND INTEREST EDUCATIONAL GUIDE
   ========================================= */

.compound-guide {
    max-width: 1100px;
    margin: 40px auto;
    padding: 36px 40px;

    background: var(--card-bg, #ffffff);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 22px;

    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.06),
        0 2px 8px rgba(15, 23, 42, 0.04);
}


/* =========================================
   MAIN GUIDE HEADING
   ========================================= */

.compound-guide > h2 {
    margin: 0 0 18px;

    font-size: clamp(1.65rem, 3vw, 2.15rem);
    line-height: 1.25;
    font-weight: 800;

    color: var(--text-primary, #0f172a);
}


/* =========================================
   SECTION HEADINGS
   ========================================= */

.compound-guide h3 {
    margin: 32px 0 12px;

    font-size: 1.2rem;
    line-height: 1.4;
    font-weight: 700;

    color: var(--text-primary, #0f172a);
}


/* =========================================
   PARAGRAPHS
   ========================================= */

.compound-guide p {
    margin: 0 0 16px;

    font-size: 1rem;
    line-height: 1.8;

    color: var(--text-secondary, #475569);
}

.compound-guide p:last-child {
    margin-bottom: 0;
}


/* =========================================
   FORMULA CARD
   ========================================= */

.compound-formula {
    position: relative;

    margin: 20px 0 24px;
    padding: 24px 28px;

    text-align: center;

    background:
        linear-gradient(
            135deg,
            rgba(37, 99, 235, 0.08),
            rgba(14, 165, 233, 0.04)
        );

    border: 1px solid rgba(37, 99, 235, 0.18);
    border-left: 4px solid #2563eb;

    border-radius: 15px;

    overflow-x: auto;
}

.compound-formula strong {
    display: block;

    font-size: clamp(1.08rem, 2.2vw, 1.3rem);
    line-height: 1.7;
    font-weight: 800;

    color: var(--text-primary, #0f172a);

    letter-spacing: 0.01em;
}

.compound-formula sup {
    font-size: 0.72em;
    vertical-align: super;
}


/* =========================================
   INTERNAL TOOL LINKS
   ========================================= */

.compound-guide a {
    color: var(--primary, #2563eb);
    font-weight: 700;
    text-decoration: none;

    border-bottom: 1px solid transparent;

    transition:
        color 0.2s ease,
        border-color 0.2s ease;
}

.compound-guide a:hover {
    border-bottom-color: currentColor;
}

.compound-guide a:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.25);
    outline-offset: 3px;
    border-radius: 4px;
}


/* =========================================
   INLINE EMPHASIS
   ========================================= */

.compound-guide p strong {
    font-weight: 750;
    color: var(--text-primary, #0f172a);
}


/* =========================================
   DARK MODE
   ========================================= */

[data-theme="dark"] .compound-guide {
    background: #111827;
    border-color: rgba(148, 163, 184, 0.16);

    box-shadow:
        0 12px 34px rgba(0, 0, 0, 0.22),
        0 2px 8px rgba(0, 0, 0, 0.14);
}

[data-theme="dark"] .compound-guide > h2,
[data-theme="dark"] .compound-guide h3,
[data-theme="dark"] .compound-guide p strong {
    color: #f8fafc;
}

[data-theme="dark"] .compound-guide p {
    color: #cbd5e1;
}

[data-theme="dark"] .compound-guide a {
    color: #60a5fa;
}


/* =========================================
   DARK MODE — FORMULA
   ========================================= */

[data-theme="dark"] .compound-formula {
    background:
        linear-gradient(
            135deg,
            rgba(59, 130, 246, 0.14),
            rgba(14, 165, 233, 0.07)
        );

    border-color: rgba(96, 165, 250, 0.20);
    border-left-color: #60a5fa;
}

[data-theme="dark"] .compound-formula strong {
    color: #f8fafc;
}


/* =========================================
   TABLET / MOBILE
   ========================================= */

@media (max-width: 768px) {

    .compound-guide {
        margin: 28px 16px;
        padding: 26px 22px;

        border-radius: 18px;
    }

    .compound-guide > h2 {
        font-size: 1.55rem;
    }

    .compound-guide h3 {
        margin-top: 26px;
        font-size: 1.1rem;
    }

    .compound-guide p {
        font-size: 0.97rem;
        line-height: 1.75;
    }

    .compound-formula {
        margin: 18px 0 22px;
        padding: 20px 18px;

        text-align: left;
    }

    .compound-formula strong {
        font-size: 1.02rem;
    }
}


/* =========================================
   SMALL MOBILE
   ========================================= */

@media (max-width: 480px) {

    .compound-guide {
        margin: 24px 12px;
        padding: 22px 18px;

        border-radius: 16px;
    }

    .compound-guide > h2 {
        font-size: 1.42rem;
    }

    .compound-guide h3 {
        font-size: 1.06rem;
    }

    .compound-formula {
        padding: 17px 16px;

        border-radius: 12px;
    }

    .compound-formula strong {
        font-size: 0.96rem;
        line-height: 1.6;
    }
}