/* Tool Layout specific to Mortgage vs Invest */

.tool-layout {
    padding: 3rem 1.5rem;
}

.tool-container {
    max-width: 1200px;
    margin: 0 auto;
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.tool-kicker {
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.tool-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.tool-intro {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 3rem;
    align-items: start;
}

@media (max-width: 950px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }
}

.tool-inputs-panel, .tool-results-panel {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.section-heading {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

/* Inputs */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-weight: 600;
}

.input-wrapper input[type="number"] {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem 0.75rem 2rem; /* space for prefix */
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.input-wrapper input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
}

.input-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

/* Sliders */
.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

input[type=range] {
    flex-grow: 1;
    -webkit-appearance: none;
    background: transparent;
    height: 30px;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--border-color);
    border-radius: 3px;
}

input[type=range]::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -6px;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.4);
}

.slider-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-color);
    min-width: 45px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Results Card */
.result-card {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    transition: border-color 0.3s, background 0.3s;
}

/* Dynamic colors for the winner */
.result-card.invest-wins {
    border-color: rgba(99, 102, 241, 0.4);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
}

.result-card.invest-wins .result-value {
    color: #818cf8;
}

.result-card.payoff-wins {
    border-color: rgba(74, 222, 128, 0.4);
    background: linear-gradient(180deg, rgba(74, 222, 128, 0.08) 0%, transparent 100%);
}

.result-card.payoff-wins .result-value {
    color: #4ade80;
}

.result-card.tie {
    border-color: rgba(156, 163, 175, 0.4);
    background: linear-gradient(180deg, rgba(156, 163, 175, 0.08) 0%, transparent 100%);
}

.result-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.result-value.huge {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0.5rem 0;
    font-variant-numeric: tabular-nums;
}

.result-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Side by Side Comparison */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.scenario-card {
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.scenario-card.winner {
    box-shadow: 0 0 15px rgba(255,255,255,0.05);
}

.scenario-card.winner::after {
    content: "WINNER";
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.scenario-header {
    background: rgba(255,255,255,0.03);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.scenario-header h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.scenario-header p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.scenario-body {
    padding: 1rem;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.metric-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.metric-row span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.metric-row strong {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.text-warning { color: #fb923c !important; }
.text-success { color: #4ade80 !important; }

/* Timeline Visualizer */
.timeline-container {
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.timeline-track {
    position: relative;
    width: 100%;
    height: 60px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-top: 1rem;
    overflow: hidden;
}

.timeline-bar {
    position: absolute;
    left: 0;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(0,0,0,0.7);
    white-space: nowrap;
    transition: width 0.4s ease-out;
}

.payoff-bar {
    top: 0;
    background: #4ade80;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.invest-bar {
    bottom: 0;
    background: #818cf8;
    color: white;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* SEO Article */
.seo-article {
    max-width: 800px;
    margin: 4rem auto;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1.1rem;
}

.seo-article h2, .seo-article h3 {
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.mt-5 { margin-top: 3rem; }
.mt-4 { margin-top: 2rem; }

/* FAQ Collapsible Styles */
.faq-section {
    margin-top: 1.5rem;
}

.faq-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: background 0.2s ease;
}

.faq-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.faq-item summary {
    padding: 1.25rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none; /* Hide default triangle */
    position: relative;
    user-select: none;
}

.faq-item summary::-webkit-details-marker {
    display: none; /* Hide Safari default triangle */
}

/* Custom animated caret */
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: transform 0.3s ease, color 0.3s ease;
    line-height: 1;
}

.faq-item[open] summary::after {
    content: '−'; /* minus sign */
    color: var(--accent-color);
    transform: translateY(-50%) rotate(180deg);
}

.faq-item[open] summary {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--accent-color);
}

.faq-content {
    padding: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.faq-content p {
    margin-top: 0;
}
.faq-content p:last-child {
    margin-bottom: 0;
}
