/* static/css/closing_costs.css */
/* Closing Costs Calculator Styles */

.closing-costs-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.page-header .subtitle {
    font-size: 1.125rem;
    color: #6b7280;
}

/* Calculator Container */
.calculator-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Form Styles */
.calculator-form {
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.input-with-prefix,
.input-with-suffix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-prefix input {
    padding-left: 2rem;
}

.input-with-suffix input {
    padding-right: 2.5rem;
}

.prefix,
.suffix {
    position: absolute;
    color: #6b7280;
    font-weight: 600;
    font-size: 1rem;
}

.prefix {
    left: 0.75rem;
}

.suffix {
    right: 0.75rem;
}

.help-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.help-text.calculated-amount {
    color: #3b82f6;
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    margin-top: 1rem;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: white;
    color: #3b82f6;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #eff6ff;
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    color: #dc2626;
}

/* Results Section */
.results-container {
    max-width: 900px;
    margin: 3rem auto 0;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.results-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.results-header .location {
    font-size: 1.125rem;
    color: #6b7280;
    font-weight: 500;
}

/* Summary Cards */
.results-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s;
}

.summary-card:hover {
    transform: translateY(-4px);
}

.summary-card.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
}

.summary-card.highlight {
    background: #fef3c7;
    border-color: #fbbf24;
}

.card-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.summary-card.primary .card-label {
    opacity: 1;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-subtitle {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Breakdown Toggle */
.breakdown-toggle {
    text-align: center;
    margin: 2rem 0;
}

#toggleBreakdown {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
}

#toggleIcon {
    transition: transform 0.3s ease;
}

/* Detailed Breakdown */
.detailed-breakdown {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.breakdown-category {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

.breakdown-category h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.breakdown-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.breakdown-row.subtotal {
    border-top: 2px solid #d1d5db;
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-weight: 700;
}

.breakdown-label {
    color: #4b5563;
}

.breakdown-amount {
    font-weight: 600;
    color: #1a1a1a;
}

/* Notes Section */
.notes-section {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.notes-section h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 1rem;
}

.notes-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notes-section li {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    position: relative;
    color: #1e3a8a;
    line-height: 1.6;
}

.notes-section li:before {
    content: "•";
    position: absolute;
    left: 0;
    font-weight: 700;
    color: #3b82f6;
    font-size: 1.25rem;
}

.notes-section li:last-child {
    margin-bottom: 0;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.action-buttons .btn-secondary {
    flex: 1;
}

/* Info Section */
.info-section {
    margin-top: 4rem;
    padding: 3rem 0;
    border-top: 1px solid #e5e7eb;
}

.info-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2rem;
    text-align: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-card h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
}

.info-card p {
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .closing-costs-page {
        padding: 1rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .calculator-container {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .results-summary {
        grid-template-columns: 1fr;
    }

    .card-value {
        font-size: 1.75rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .calculator-form,
    .action-buttons,
    .breakdown-toggle,
    .info-section {
        display: none;
    }

    .detailed-breakdown {
        display: grid !important;
    }

    .results-container {
        box-shadow: none;
        border: 1px solid #000;
    }

    .page-header,
    .results-header {
        page-break-after: avoid;
    }

    .breakdown-category {
        page-break-inside: avoid;
    }
}
