/* Property Investment Calculator Styles - Mobile-First Design */

*,
*::before,
*::after {
    border-radius: 0 !important;
}

*::-webkit-scrollbar,
*::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-track {
    border-radius: 0 !important;
}

.property-investment {
    padding: 1.5rem 0 2rem;
    color: var(--text-color, #111827);
}

[data-theme="dark"] .property-investment {
    color: var(--text-color, #f9fafb);
}

/* Header Section */
.property-investment__header {
    margin-bottom: 2rem;
    display: grid;
    gap: 0.875rem;
}

.property-investment__label {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--badge-bg, rgba(220, 38, 38, 0.1));
    color: var(--badge-text, #b91c1c);
    font-weight: 600;
    font-size: 0.8125rem;
    width: max-content;
}

[data-theme="dark"] .property-investment__label {
    background: rgba(252, 165, 165, 0.16);
    color: #fca5a5;
}

.property-investment__title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin: 0;
    line-height: 1.2;
    color: var(--heading-color, #0f172a);
    word-wrap: break-word;
}

[data-theme="dark"] .property-investment__title {
    color: var(--heading-color, #f8fafc);
}

.property-investment__lede {
    max-width: 100%;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary, #4b5563);
}

[data-theme="dark"] .property-investment__lede {
    color: var(--text-secondary, #cbd5e1);
}

.property-investment__meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
}

.property-investment__meta-label {
    display: block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.6875rem;
    color: var(--text-muted, #6b7280);
    margin-bottom: 0.125rem;
}

/* Layout - Mobile-First (Stacked) */
.property-investment__layout {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

/* Desktop: Side-by-side layout */
@media (min-width: 1024px) {
    .property-investment__layout {
        grid-template-columns: 450px 1fr;
        gap: 2.5rem;
    }
}

/* Form Styles */
.property-investment-form {
    display: grid;
    gap: 1.5rem;
}

.property-investment-form fieldset {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 0;
    background: var(--card-bg, #ffffff);
}

[data-theme="dark"] .property-investment-form fieldset {
    border-color: var(--border-color, #374151);
    background: var(--card-bg, #1e293b);
}

.property-investment-form legend {
    font-weight: 700;
    font-size: 1.125rem;
    padding: 0 0.5rem;
    color: var(--heading-color, #0f172a);
}

[data-theme="dark"] .property-investment-form legend {
    color: var(--heading-color, #f1f5f9);
}

.field-grid {
    display: grid;
    gap: 1.25rem;
    margin-top: 1rem;
}

/* Responsive grid for larger screens */
@media (min-width: 640px) {
    .field-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

.field-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--text-color, #1f2937);
}

[data-theme="dark"] .field-grid label {
    color: var(--text-color, #e2e8f0);
}

.field-grid input[type="number"],
.field-grid input[type="text"],
.field-grid select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--input-border, #d1d5db);
    border-radius: 8px;
    font-size: 0.9375rem;
    background: var(--input-bg, #ffffff);
    color: var(--text-color, #111827);
    transition: all 0.15s ease;
}

.field-grid input[type="number"]:focus,
.field-grid input[type="text"]:focus,
.field-grid select:focus {
    outline: none;
    border-color: var(--primary-color, #dc2626);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

[data-theme="dark"] .field-grid input[type="number"],
[data-theme="dark"] .field-grid input[type="text"],
[data-theme="dark"] .field-grid select {
    background: var(--input-bg, #0f172a);
    border-color: var(--input-border, #475569);
    color: var(--text-color, #f1f5f9);
}

.field-grid input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    accent-color: var(--primary-color, #dc2626);
}

.field-note {
    font-size: 0.8125rem;
    color: var(--text-muted, #6b7280);
    font-weight: 400;
    line-height: 1.4;
}

[data-theme="dark"] .field-note {
    color: var(--text-muted, #94a3b8);
}

/* Calculated Summary in Forms */
.calc-summary {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e5e7eb);
}

[data-theme="dark"] .calc-summary {
    background: var(--bg-secondary, #0f172a);
    border-color: var(--border-color, #334155);
}

.calc-summary h4 {
    margin: 0 0 0.875rem 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--heading-color, #0f172a);
}

[data-theme="dark"] .calc-summary h4 {
    color: var(--heading-color, #f1f5f9);
}

.calc-summary__list {
    display: grid;
    gap: 0.625rem;
    margin: 0;
}

.calc-summary__list > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.calc-summary__list dt {
    font-weight: 400;
    color: var(--text-secondary, #4b5563);
}

.calc-summary__list dd {
    font-weight: 600;
    color: var(--text-color, #111827);
    margin: 0;
}

[data-theme="dark"] .calc-summary__list dt {
    color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .calc-summary__list dd {
    color: var(--text-color, #f9fafb);
}

.calc-summary__list .summary-total {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 2px solid var(--border-color, #d1d5db);
    font-size: 0.9375rem;
}

.calc-summary__list .summary-total dt {
    font-weight: 600;
    color: var(--heading-color, #0f172a);
}

.calc-summary__list .summary-total dd {
    font-weight: 700;
    color: var(--primary-color, #dc2626);
}

/* Results Section */
.property-investment-results {
    display: grid;
    gap: 1.5rem;
}

/* Hero Summary */
.results-hero {
    background: linear-gradient(135deg, var(--primary-color, #dc2626) 0%, #b91c1c 100%);
    color: #ffffff;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.2);
}

[data-theme="dark"] .results-hero {
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.4);
}

.results-hero__badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.results-hero__headline {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    opacity: 0.95;
}

.results-hero__value {
    font-size: clamp(2.25rem, 6vw, 3.5rem);
    font-weight: 800;
    margin: 0.5rem 0;
    line-height: 1;
}

.results-hero__description {
    font-size: 0.9375rem;
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
}

/* Results Cards */
.results-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .results-card {
    background: var(--card-bg, #1e293b);
    border-color: var(--border-color, #334155);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.results-card header {
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border-color, #e5e7eb);
    padding-bottom: 0.875rem;
}

[data-theme="dark"] .results-card header {
    border-color: var(--border-color, #334155);
}

.results-card h3 {
    margin: 0 0 0.375rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--heading-color, #0f172a);
}

[data-theme="dark"] .results-card h3 {
    color: var(--heading-color, #f1f5f9);
}

.results-card header p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
}

[data-theme="dark"] .results-card header p {
    color: var(--text-secondary, #94a3b8);
}

.results-card__metrics {
    display: grid;
    gap: 1rem;
    margin: 0;
}

.results-card__metrics > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.results-card__metrics dt {
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text-secondary, #4b5563);
    flex: 1;
}

.results-card__metrics dd {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-color, #111827);
    margin: 0;
    text-align: right;
}

[data-theme="dark"] .results-card__metrics dt {
    color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .results-card__metrics dd {
    color: var(--text-color, #f1f5f9);
}

.results-card__metrics .highlight {
    background: var(--bg-highlight, rgba(220, 38, 38, 0.05));
    margin: 0 -0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
}

[data-theme="dark"] .results-card__metrics .highlight {
    background: rgba(220, 38, 38, 0.15);
}

.results-card__metrics .summary-total {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color, #d1d5db);
}

[data-theme="dark"] .results-card__metrics .summary-total {
    border-color: var(--border-color, #475569);
}

.results-card__metrics .summary-total dt {
    font-weight: 600;
    font-size: 1rem;
    color: var(--heading-color, #0f172a);
}

.results-card__metrics .summary-total dd {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--primary-color, #dc2626);
}

[data-theme="dark"] .results-card__metrics .summary-total dt {
    color: var(--heading-color, #f1f5f9);
}

/* Value highlighting */
.results-card__metrics dd.positive {
    color: #059669;
}

.results-card__metrics dd.negative {
    color: #dc2626;
}

/* Metric List (Alternative style) */
.metric-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.875rem;
}

.metric-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 8px;
}

[data-theme="dark"] .metric-list li {
    background: var(--bg-secondary, #0f172a);
}

.metric-list__label {
    font-size: 0.9375rem;
    color: var(--text-secondary, #4b5563);
}

.metric-list__value {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-color, #111827);
}

[data-theme="dark"] .metric-list__label {
    color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .metric-list__value {
    color: var(--text-color, #f1f5f9);
}

/* Sensitivity Analysis Panel */
.sensitivity-panel {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 0;
    margin-top: 1rem;
}

[data-theme="dark"] .sensitivity-panel {
    background: var(--card-bg, #1e293b);
    border-color: var(--border-color, #334155);
}

.sensitivity-panel summary {
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.sensitivity-panel summary::-webkit-details-marker {
    display: none;
}

.sensitivity-panel summary::after {
    content: '▼';
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
    transition: transform 0.2s ease;
}

.sensitivity-panel[open] summary::after {
    transform: rotate(180deg);
}

.sensitivity-panel summary h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--heading-color, #0f172a);
}

.sensitivity-panel summary p {
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
    margin: 0.25rem 0 0 0;
}

[data-theme="dark"] .sensitivity-panel summary h3 {
    color: var(--heading-color, #f1f5f9);
}

[data-theme="dark"] .sensitivity-panel summary p {
    color: var(--text-secondary, #94a3b8);
}

.sensitivity-grid {
    padding: 0 1.5rem 1.5rem 1.5rem;
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .sensitivity-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sensitivity-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.875rem 0;
    color: var(--heading-color, #0f172a);
}

[data-theme="dark"] .sensitivity-section h4 {
    color: var(--heading-color, #f1f5f9);
}

.sensitivity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.sensitivity-table thead {
    background: var(--bg-secondary, #f3f4f6);
}

[data-theme="dark"] .sensitivity-table thead {
    background: var(--bg-secondary, #0f172a);
}

.sensitivity-table th {
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary, #4b5563);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

[data-theme="dark"] .sensitivity-table th {
    color: var(--text-secondary, #cbd5e1);
}

.sensitivity-table td {
    padding: 0.75rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
    color: var(--text-color, #111827);
}

[data-theme="dark"] .sensitivity-table td {
    border-color: var(--border-color, #334155);
    color: var(--text-color, #e2e8f0);
}

.sensitivity-table tr.current-scenario {
    background: rgba(220, 38, 38, 0.05);
    font-weight: 600;
}

[data-theme="dark"] .sensitivity-table tr.current-scenario {
    background: rgba(220, 38, 38, 0.15);
}

/* Insight Panel */
.insight-panel {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 1.5rem;
}

[data-theme="dark"] .insight-panel {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
    border-color: #334155;
}

.insight-panel h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e40af;
}

[data-theme="dark"] .insight-panel h3 {
    color: #93c5fd;
}

.insight-panel p {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #1e40af;
}

[data-theme="dark"] .insight-panel p {
    color: #bfdbfe;
}

/* Article Content Section */
.property-investment__content {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color, #e5e7eb);
}

[data-theme="dark"] .property-investment__content {
    border-color: var(--border-color, #334155);
}

.property-investment__copy {
    max-width: 75ch;
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text-color, #1f2937);
}

[data-theme="dark"] .property-investment__copy {
    color: var(--text-color, #e2e8f0);
}

.property-investment__copy h2 {
    margin: 2rem 0 1rem 0;
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--heading-color, #0f172a);
}

[data-theme="dark"] .property-investment__copy h2 {
    color: var(--heading-color, #f1f5f9);
}

.property-investment__copy h3 {
    margin: 1.5rem 0 0.75rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--heading-color, #1f2937);
}

[data-theme="dark"] .property-investment__copy h3 {
    color: var(--heading-color, #e2e8f0);
}

.property-investment__copy p {
    margin: 0 0 1.25rem 0;
}

.property-investment__copy ul,
.property-investment__copy ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.property-investment__copy li {
    margin: 0.5rem 0;
}

/* Responsive adjustments */
@media (min-width: 640px) {
    .rentvesting__meta {
        flex-direction: row;
        gap: 1.5rem;
    }
}

@media (min-width: 768px) {
    .property-investment {
        padding: 2rem 0 3rem;
    }

    .property-investment__header {
        margin-bottom: 2.5rem;
    }

    .property-investment__lede {
        max-width: 65ch;
    }
}

/* Print styles */
@media print {
    .property-investment-form {
        display: none;
    }

    .property-investment-results {
        page-break-inside: avoid;
    }
}
