/**
 * FinancePress Financial Calculators Styles
 */

/* Calculator Page Layout */
.fp-calculator-page {
    padding: 2rem 0;
}

.fp-calculator-header {
    margin-bottom: 2rem;
    text-align: center;
}

.fp-calculator-desc {
    font-size: 1.125rem;
    color: var(--fp-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Calculator Wrapper */
.fp-calculator-wrapper {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .fp-calculator-wrapper {
        grid-template-columns: 1fr 1fr;
    }
}

/* Calculator Form */
.fp-calc-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2rem;
}

.fp-calc-field {
    margin-bottom: 1.5rem;
}

.fp-calc-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #0A2540;
}

.fp-calc-optional {
    font-weight: 400;
    color: #999;
    font-size: 0.875rem;
}

/* Input Groups */
.fp-calc-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.fp-calc-prefix,
.fp-calc-suffix {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.fp-calc-prefix {
    border-radius: 4px 0 0 4px;
    border-right: 0;
}

.fp-calc-suffix {
    border-radius: 0 4px 4px 0;
    border-left: 0;
}

.fp-calc-input-group input[type="number"],
.fp-calc-input-group input[type="text"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    font-size: 1rem;
    min-width: 0;
}

.fp-calc-input-group input:first-child {
    border-radius: 4px 0 0 4px;
}

.fp-calc-input-group input:last-child {
    border-radius: 0 4px 4px 0;
}

.fp-calc-input-group input:not(:first-child):not(:last-child) {
    border-radius: 0;
}

/* Select */
.fp-calc-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 1rem;
    background: #fff;
}

/* Radio Groups */
.fp-calc-radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.fp-calc-radio-group--grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.fp-calc-radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.fp-calc-radio:hover {
    border-color: #0066FF;
    background: #f0f7ff;
}

.fp-calc-radio input:checked + span {
    color: #0066FF;
    font-weight: 600;
}

/* Slider */
.fp-calc-slider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.fp-calc-slider input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
}

.fp-calc-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0066FF;
    cursor: pointer;
}

.fp-calc-slider-value {
    font-weight: 600;
    color: #0066FF;
    min-width: 60px;
    text-align: right;
}

/* Hint Text */
.fp-calc-hint {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Buttons */
.fp-btn--lg {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

/* Results Section */
.fp-calculator-results {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2rem;
}

/* Result Cards */
.fp-result-card {
    background: linear-gradient(135deg, #0A2540 0%, #1a3a5c 100%);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.fp-result-card--primary {
    color: #fff;
}

.fp-result-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.fp-result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #D4AF37;
}

/* Result Breakdown */
.fp-result-breakdown,
.fp-result-summary,
.fp-result-inflation,
.fp-result-comparison {
    margin-bottom: 2rem;
}

.fp-result-breakdown-title,
.fp-result-chart-title,
.fp-result-table-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0A2540;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.fp-result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.fp-result-item:last-child {
    border-bottom: 0;
}

.fp-result-item-label {
    color: #6b7280;
}

.fp-result-item-value {
    font-weight: 600;
    color: #0A2540;
}

.fp-result-item--highlight .fp-result-item-value {
    color: #0066FF;
}

.fp-result-item--success .fp-result-item-value {
    color: #10b981;
}

.fp-result-item--warning .fp-result-item-value {
    color: #f59e0b;
}

/* Comparison Grid */
.fp-comparison-grid {
    display: grid;
    gap: 0.5rem;
}

.fp-comparison-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 4px;
}

.fp-comparison-label {
    color: #6b7280;
}

.fp-comparison-value {
    font-weight: 600;
    color: #0A2540;
}

/* Chart */
.fp-result-chart {
    margin-bottom: 2rem;
}

.fp-result-chart canvas {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
}

/* Data Table */
.fp-table-wrapper {
    overflow-x: auto;
}

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

.fp-data-table th,
.fp-data-table td {
    padding: 0.75rem;
    text-align: right;
    border-bottom: 1px solid #e5e7eb;
}

.fp-data-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #0A2540;
}

.fp-data-table th:first-child,
.fp-data-table td:first-child {
    text-align: left;
}

/* Calculator Info Section */
.fp-calculator-info {
    background: #f9fafb;
    border-radius: 8px;
    padding: 2rem;
}

.fp-calculator-info h2 {
    font-size: 1.5rem;
    color: #0A2540;
    margin-bottom: 1.5rem;
}

/* Info Grid */
.fp-info-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.fp-info-item h3 {
    font-size: 1.125rem;
    color: #0A2540;
    margin-bottom: 0.5rem;
}

.fp-info-item p {
    color: #6b7280;
    line-height: 1.6;
}

/* Tips */
.fp-info-tips {
    background: #fff;
    border-left: 4px solid #D4AF37;
    padding: 1.5rem;
    border-radius: 4px;
}

.fp-info-tips h3 {
    font-size: 1.125rem;
    color: #0A2540;
    margin-bottom: 1rem;
}

.fp-info-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fp-info-tips li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #6b7280;
}

.fp-info-tips li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* Example */
.fp-info-example {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

.fp-info-example h3 {
    font-size: 1.125rem;
    color: #0A2540;
    margin-bottom: 1rem;
}

.fp-info-example ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.fp-info-example li {
    padding: 0.5rem 0;
    color: #0A2540;
    font-weight: 500;
}

.fp-info-note {
    color: #6b7280;
    font-style: italic;
}

/* Formula Box */
.fp-formula-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.fp-formula-box h3 {
    font-size: 1.125rem;
    color: #0A2540;
    margin-bottom: 1rem;
}

.fp-formula {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0066FF;
    text-align: center;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.fp-formula-legend {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.fp-formula-legend li {
    color: #6b7280;
}

.fp-formula-legend strong {
    color: #0A2540;
}

/* Dark Mode */
[data-theme="dark"] .fp-calc-form,
[data-theme="dark"] .fp-calculator-results,
[data-theme="dark"] .fp-info-tips,
[data-theme="dark"] .fp-info-example,
[data-theme="dark"] .fp-formula-box {
    background: #1a1a1a;
    border-color: #333;
}

[data-theme="dark"] .fp-calculator-info {
    background: #0f0f0f;
}

[data-theme="dark"] .fp-calc-label,
[data-theme="dark"] .fp-result-breakdown-title,
[data-theme="dark"] .fp-result-chart-title,
[data-theme="dark"] .fp-result-table-title,
[data-theme="dark"] .fp-calculator-info h2,
[data-theme="dark"] .fp-info-item h3,
[data-theme="dark"] .fp-info-tips h3,
[data-theme="dark"] .fp-info-example h3,
[data-theme="dark"] .fp-formula-box h3 {
    color: #fff;
}

[data-theme="dark"] .fp-calc-prefix,
[data-theme="dark"] .fp-calc-suffix {
    background: #2a2a2a;
    border-color: #444;
    color: #999;
}

[data-theme="dark"] .fp-calc-input-group input,
[data-theme="dark"] .fp-calc-select {
    background: #1a1a1a;
    border-color: #444;
    color: #fff;
}

[data-theme="dark"] .fp-calc-radio {
    border-color: #444;
}

[data-theme="dark"] .fp-calc-radio:hover {
    border-color: #0066FF;
    background: rgba(0, 102, 255, 0.1);
}

[data-theme="dark"] .fp-result-item-value,
[data-theme="dark"] .fp-comparison-value {
    color: #fff;
}

[data-theme="dark"] .fp-data-table th {
    background: #2a2a2a;
    color: #fff;
}

[data-theme="dark"] .fp-data-table td {
    border-color: #333;
}