/* Mortgage Interest Deduction Calculator CSS - 2025 Professional Design */
:root {
    /* Primary Color Palette - Home/Real Estate Theme */
    --primary-color: #204080;
    --secondary-color: #5AC8FA;
    --dark-color: #0056CC;
    --light-color: #E3F2FD;
    
    /* Mortgage-Specific Colors */
    --home-blue: #1976d2;
    --property-green: #388e3c;
    --mortgage-gold: #f57c00;
    --equity-purple: #7b1fa2;
    --real-estate-brown: #5d4037;
    
    /* Status Colors */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
    
    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    
    /* Border and Shadow */
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gradient-home: linear-gradient(135deg, var(--home-blue) 0%, var(--property-green) 100%);
    --gradient-mortgage: linear-gradient(135deg, var(--mortgage-gold) 0%, var(--equity-purple) 100%);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Breadcrumb Navigation */
.breadcrumb {
    background: var(--bg-secondary);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb-content {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: var(--dark-color);
    text-decoration: underline;
}

/* Hero Section */
.hero {
    background: var(--gradient-home);
    color: white;
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M30 0l30 30-30 30L0 30z' transform='scale(0.5)'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Calculator Section */
.calculator-section {
    padding: 4rem 0;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* Form Styling */
.calculator-form {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.form-grid {
    display: grid;
    gap: 2.5rem;
}

.form-section {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    position: relative;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-home);
    border-radius: 2px 0 0 2px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--home-blue);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: '🏠';
    font-size: 1.5rem;
}

.form-section:nth-child(2) .section-title::before { content: '🏡'; }
.form-section:nth-child(3) .section-title::before { content: '🏘️'; }
.form-section:nth-child(4) .section-title::before { content: '📊'; }

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

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

.input-label.required::after {
    content: ' *';
    color: var(--error-color);
    font-weight: 700;
}

.input-field {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: var(--font-primary);
    background: var(--bg-primary);
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.input-field:focus {
    outline: none;
    border-color: var(--home-blue);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
    background: var(--bg-primary);
}

.input-field:hover {
    border-color: var(--property-green);
}

.input-field.error {
    border-color: var(--error-color);
    background-color: rgba(239, 68, 68, 0.05);
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-style: italic;
}

/* Conditional Field Groups */
#secondHomeDetails,
#helocDetails,
#refinanceDetails {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
    transition: all 0.3s ease;
}

#secondHomeDetails.show,
#helocDetails.show,
#refinanceDetails.show {
    border-color: var(--home-blue);
    background: rgba(25, 118, 210, 0.02);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.calculate-btn {
    background: var(--gradient-home);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-md);
    min-width: 250px;
    justify-content: center;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.calculate-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.calculate-btn:hover .btn-icon {
    transform: scale(1.1);
}

/* Results Section */
.results-section {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    margin-top: 2rem;
}

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

.results-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--home-blue);
    margin-bottom: 0.5rem;
}

.results-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

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

.result-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-home);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.result-card:hover::before {
    transform: scaleY(1);
}

.result-card.primary {
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.1) 0%, rgba(56, 142, 60, 0.1) 100%);
    border-color: var(--home-blue);
}

.result-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--gradient-home);
    border-radius: 50%;
    color: white;
    box-shadow: var(--shadow-md);
}

.result-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--home-blue);
    margin-bottom: 0.25rem;
    font-family: var(--font-mono);
}

.result-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Breakdown and Recommendations */
.breakdown-section,
.recommendations-section {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-light);
}

.breakdown-section h3,
.recommendations-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--home-blue);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breakdown-section h3::before {
    content: '📊';
    font-size: 1.5rem;
}

.recommendations-section h3::before {
    content: '💡';
    font-size: 1.5rem;
}

.breakdown-content,
.recommendations-content {
    /* Content will be populated by JavaScript */
}

/* Mortgage Breakdown Table */
.mortgage-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.mortgage-breakdown-table th,
.mortgage-breakdown-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.mortgage-breakdown-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--home-blue);
}

.mortgage-breakdown-table .deductible-amount {
    font-weight: 600;
    color: var(--property-green);
    font-family: var(--font-mono);
}

.mortgage-breakdown-table .non-deductible-amount {
    font-weight: 600;
    color: var(--error-color);
    font-family: var(--font-mono);
}

/* Debt Limit Warning */
.debt-limit-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(239, 68, 68, 0.1) 100%);
    border: 1px solid var(--warning-color);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.debt-limit-warning::before {
    content: '⚠️';
    font-size: 1rem;
}

.debt-limit-warning span {
    color: var(--warning-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Info Section */
.info-section {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.info-section h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--home-blue);
    margin-bottom: 3rem;
}

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

.info-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.info-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--home-blue);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-card h3::before {
    content: '🏠';
    font-size: 1.2rem;
}

.info-card:nth-child(2) h3::before { content: '✅'; }
.info-card:nth-child(3) h3::before { content: '🔄'; }

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-card li:last-child {
    border-bottom: none;
}

.info-card li::before {
    content: '→';
    color: var(--property-green);
    font-weight: 700;
}

.info-card strong {
    color: var(--home-blue);
    font-weight: 600;
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
    background: var(--bg-primary);
}

.faq-section h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--home-blue);
    margin-bottom: 3rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.faq-item {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
}

.faq-item::before {
    content: 'Q';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 30px;
    height: 30px;
    background: var(--gradient-home);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.faq-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--home-blue);
    margin-bottom: 1rem;
    line-height: 1.4;
    padding-right: 2rem;
}

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

/* Related Calculators */
.related-calculators {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.related-calculators h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--home-blue);
    margin-bottom: 3rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.related-card {
    display: block;
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.related-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-home);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    text-decoration: none;
}

.related-card:hover::before {
    transform: scaleX(1);
}

.related-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.related-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--home-blue);
    margin-bottom: 1rem;
}

.related-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Validation Modal */
.validation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.validation-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.validation-modal.show .modal-content {
    transform: scale(1);
}

.modal-content h3 {
    color: var(--error-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.modal-close {
    background: var(--gradient-home);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: all 0.2s ease;
}

.modal-close:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Error Styling */
.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message::before {
    content: '⚠️';
    font-size: 1rem;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top-color: var(--home-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 2.5rem 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .calculator-section {
        padding: 2rem 0;
    }
    
    .calculator-form {
        padding: 1.5rem;
    }
    
    .form-section {
        padding: 1.5rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .result-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .info-grid,
    .faq-grid,
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .calculate-btn {
        width: 100%;
        margin-top: 1rem;
    }
    
    #secondHomeDetails,
    #helocDetails,
    #refinanceDetails {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .calculator-form {
        padding: 1rem;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
}

/* Print Styles */
@media print {
    .hero,
    .related-calculators,
    .calculate-btn,
    .validation-modal {
        display: none;
    }
    
    .results-section {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
    
    .result-card {
        break-inside: avoid;
    }
    
    .info-section {
        break-inside: avoid;
    }
} 