/* Living Costs in Retirement Calculator - Standardized Styling */

.lcre-root {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #083141;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
}

.lcre-app {
    background: #ffffff;
    border: 1px solid #083141;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* Loading State */
.lcre-loading {
    padding: 2rem;
    text-align: center;
    color: #59747C;
    font-size: 1rem;
}

/* Header */
.lcre-header {
    margin-bottom: 1.5rem;
}

.lcre-title {
    margin: 0 0 0.3rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #083141;
}

.lcre-subtitle {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
    color: #334155;
}

/* Steps */
.lcre-step {
    border-top: 1px solid #e5e7eb;
    padding-top: 1.25rem;
    margin-top: 1.25rem;
}

.lcre-step:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.lcre-step-title {
    margin: 0 0 0.2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #083141;
}

.lcre-step-help {
    margin: 0 0 0.9rem;
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Subsection */
.lcre-subsection {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.lcre-subsection:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.lcre-subsection-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #083141;
}

/* Grid */
.lcre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.9rem;
    align-items: start;
}

.lcre-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
    .lcre-grid,
    .lcre-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .lcre-app {
        padding: 1rem;
    }
    
    .lcre-title {
        font-size: 1.3rem;
    }
    
    .lcre-step-title {
        font-size: 1rem;
    }
}

/* Fields */
.lcre-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.lcre-field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lcre-field label input[type="radio"],
.lcre-field label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.lcre-help-text {
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.4;
    margin-top: 0.25rem;
}

.lcre-data-note {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.5;
    margin: 0.5rem 0 1rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-left: 3px solid #9BBAC8;
    border-radius: 4px;
}

.lcre-data-period-note {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.5;
}

.lcre-data-period-note strong {
    color: #083141;
    font-weight: 600;
}

/* Input Fields */
.lcre-input-field {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.4rem 0.55rem;
    font-size: 0.9rem;
    box-sizing: border-box;
    background: #f9fafb;
    color: #111827;
    outline: none;
    transition: all 0.2s;
}

.lcre-input-field:focus {
    outline: 2px solid #083141;
    outline-offset: 0;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(8, 49, 65, 0.15);
    border-color: #083141;
}

.lcre-input-field:hover:not(:disabled) {
    border-color: #9ca3af;
}

/* Slider */
.lcre-slider-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lcre-slider-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.lcre-slider {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.lcre-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #083141;
    border-radius: 50%;
    cursor: pointer;
}

.lcre-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #083141;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.lcre-input-number {
    width: 80px;
    text-align: center;
}

.lcre-slider-presets {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Buttons */
.lcre-btn-small,
.lcre-btn-tiny {
    background: #59747C;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.lcre-btn-tiny {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.lcre-btn-small:hover,
.lcre-btn-tiny:hover {
    background: #47616b;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lcre-btn-small:active,
.lcre-btn-tiny:active {
    transform: translateY(0);
}

/* Info & Summary Boxes */
.lcre-info-box {
    background: #EBF2F4;
    border: 1px solid #9BBAC8;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #083141;
    line-height: 1.5;
}

.lcre-summary-box {
    background: #f0f9ff;
    border: 2px solid #083141;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 1rem;
    color: #083141;
    text-align: center;
}

/* Comparison Box */
.lcre-comparison-box {
    background: #f9fafb;
    border: 2px solid #9BBAC8;
    border-radius: 10px;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.lcre-comparison-title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #083141;
}

.lcre-comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.lcre-comparison-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}

.lcre-comparison-item strong {
    display: block;
    font-size: 0.95rem;
    color: #083141;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #9BBAC8;
}

.lcre-comparison-list {
    margin: 0;
    padding-left: 1.25rem;
    list-style: none;
}

.lcre-comparison-list li {
    font-size: 0.85rem;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.25rem;
}

.lcre-comparison-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #59747C;
    font-weight: 600;
}

.lcre-comparison-list li:last-child {
    margin-bottom: 0;
}

@media (max-width: 720px) {
    .lcre-comparison-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .lcre-comparison-box {
        padding: 1rem;
    }
}

/* Results Section */
.lcre-results {
    margin-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 1.25rem;
}

.lcre-results-title {
    margin: 0 0 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #083141;
}

.lcre-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.lcre-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.lcre-card-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.lcre-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #083141;
    margin-bottom: 0.25rem;
}

.lcre-card-detail {
    font-size: 0.75rem;
    color: #9ca3af;
}

@media (max-width: 720px) {
    .lcre-summary-cards {
        grid-template-columns: 1fr;
    }
}

/* Charts */
.lcre-chart-container {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.lcre-chart-title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #083141;
}

.lcre-chart-canvas {
    max-height: 400px;
    position: relative;
}

@media (max-width: 720px) {
    .lcre-chart-container {
        padding: 0.75rem;
    }
    
    .lcre-chart-canvas {
        max-height: 300px;
    }
}

/* Tables */
.lcre-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

.lcre-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #ffffff;
}

.lcre-table th {
    background: #EBF2F4;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #083141;
    border: 1px solid #9BBAC8;
    font-size: 0.85rem;
}

.lcre-table td {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    color: #374151;
}

.lcre-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.lcre-table tbody tr:hover {
    background: #f0f0f0;
}

.lcre-number {
    font-weight: 600;
    color: #083141;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.lcre-breakdown-small {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Expandable table with card-based breakdown */
.lcre-table-expandable {
    font-size: 0.9rem;
}

.lcre-table-row-main {
    cursor: pointer;
    transition: background-color 0.2s;
}

.lcre-table-row-main:hover {
    background: #f0f9ff !important;
}

.lcre-table-row-main.expanded {
    background: #EBF2F4;
    border-bottom: 2px solid #083141;
}

.lcre-age-cell {
    font-size: 1rem;
    font-weight: 600;
    color: #083141;
}

.lcre-total-cell {
    font-size: 1.1rem;
}

.lcre-expand-cell {
    user-select: none;
}

.lcre-expand-icon {
    display: inline-block;
    font-size: 0.8rem;
    color: #59747C;
    transition: transform 0.2s;
}

.lcre-table-row-main.expanded .lcre-expand-icon {
    transform: rotate(0deg);
}

.lcre-table-row-detail {
    background: #f9fafb;
}

.lcre-table-row-detail td {
    padding: 0 !important;
    border: none;
}

.lcre-breakdown-expanded {
    padding: 1.5rem;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.lcre-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.lcre-category-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s;
}

.lcre-category-card:hover {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.lcre-category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.lcre-category-icon {
    font-size: 1.2rem;
}

.lcre-category-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.lcre-category-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #083141;
    margin-bottom: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.lcre-category-percent {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

/* Detailed table with more columns - smaller font (legacy) */
.lcre-table-detailed {
    font-size: 0.75rem;
}

.lcre-table-detailed th {
    font-size: 0.7rem;
    padding: 0.5rem 0.4rem;
    white-space: nowrap;
}

.lcre-table-detailed td {
    padding: 0.5rem 0.4rem;
}

.lcre-table-small {
    font-size: 0.7rem;
}

@media (max-width: 720px) {
    .lcre-table {
        font-size: 0.8rem;
    }
    
    .lcre-table th,
    .lcre-table td {
        padding: 0.5rem;
    }
    
    .lcre-breakdown-small {
        font-size: 0.7rem;
    }
    
    .lcre-table-expandable {
        font-size: 0.85rem;
    }
    
    .lcre-age-cell {
        font-size: 0.9rem;
    }
    
    .lcre-total-cell {
        font-size: 1rem;
    }
    
    .lcre-breakdown-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.75rem;
    }
    
    .lcre-category-card {
        padding: 0.75rem;
    }
    
    .lcre-category-value {
        font-size: 1rem;
    }
    
    .lcre-breakdown-expanded {
        padding: 1rem;
    }
    
    .lcre-table-detailed {
        font-size: 0.65rem;
    }
    
    .lcre-table-detailed th {
        font-size: 0.6rem;
        padding: 0.4rem 0.3rem;
    }
    
    .lcre-table-detailed td {
        padding: 0.4rem 0.3rem;
    }
    
    .lcre-table-small {
        font-size: 0.6rem;
    }
}

/* Print Styles */
@media print {
    .lcre-root {
        max-width: 100%;
        padding: 0;
    }
    
    .lcre-app {
        border: none;
        box-shadow: none;
        padding: 0;
    }
    
    .lcre-btn-small,
    .lcre-btn-tiny {
        display: none;
    }
    
    .lcre-chart-container {
        page-break-inside: avoid;
    }
}

/* Accessibility */
.lcre-input-field:focus-visible,
.lcre-btn-small:focus-visible,
.lcre-btn-tiny:focus-visible {
    outline: 3px solid #083141;
    outline-offset: 2px;
}

/* Export Button */
.lcre-export-btn {
    background: #083141;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.lcre-export-btn:hover {
    background: #0a3d51;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(8, 49, 65, 0.2);
}

.lcre-export-btn:active {
    transform: translateY(0);
}

.lcre-export-btn:focus-visible {
    outline: 3px solid #083141;
    outline-offset: 2px;
}

@media (max-width: 720px) {
    .lcre-export-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Utility Classes */
.lcre-text-center {
    text-align: center;
}

.lcre-mt-1 {
    margin-top: 0.5rem;
}

.lcre-mt-2 {
    margin-top: 1rem;
}

.lcre-mb-1 {
    margin-bottom: 0.5rem;
}

.lcre-mb-2 {
    margin-bottom: 1rem;
}
