/* Custom CSS for US Mortgage Calculators Hub - Optimized Version */

/* Font optimization */
@font-face {
    font-family: 'System Font';
    font-display: swap;
}

/* Calculator input styling */
.input-field {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Button hover effects */
.calculate-btn {
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.calculate-btn:hover {
    transform: translateY(-1px);
}

/* Calculator section backgrounds - ensure white backgrounds */
.calculator-section {
    background-color: #ffffff !important;
}

.calculator-input-card {
    background-color: #f9fafb !important;
}

.results-card {
    background-color: #ffffff !important;
}

.amortization-card {
    background-color: #ffffff !important;
}

.comparison-card {
    background-color: #ffffff !important;
}

.table-header {
    background-color: #f9fafb !important;
}

.table-row {
    background-color: #ffffff !important;
}

.result-item {
    background-color: #dbeafe !important;
}

.total-payment-card {
    background-color: #f3f4f6 !important;
}

/* Home page calculator specific styles */
.calculator-card {
    background-color: #ffffff !important;
}

.result-card {
    background-color: #ffffff !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .calculator-card {
        box-shadow: none;
        border-radius: 0;
        margin-bottom: 1rem;
        min-height: auto; /* Allow flexible height on mobile */
    }
    
    .calculator-content {
        padding: 1rem;
    }
    
    .hero-heading {
        font-size: 1.5rem;
        min-height: auto;
    }
    
    .hero-subtext {
        font-size: 1rem;
        min-height: auto;
    }
    
    .result-card {
        min-height: auto; /* Allow flexible height on mobile */
    }
    
    .calculator-grid {
        gap: 1rem;
    }
}

/* Desktop-specific optimizations */
@media (min-width: 1024px) {
    /* Only apply heavy shadows on desktop where performance is better */
    .calculator-card {
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    }
    
    /* Optimize transitions for desktop */
    .nav-link {
        transition: color 0.2s ease, background-color 0.2s ease;
    }
    
    .calculate-btn {
        transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    .calculator-section {
        background-color: #ffffff !important;
    }
    
    .calculator-input-card {
        background-color: #f9fafb !important;
    }
    
    .results-card {
        background-color: #ffffff !important;
    }
    
    .amortization-card {
        background-color: #ffffff !important;
    }
    
    .comparison-card {
        background-color: #ffffff !important;
    }
    
    .table-header {
        background-color: #f9fafb !important;
    }
    
    .table-row {
        background-color: #ffffff !important;
    }
    
    .result-item {
        background-color: #dbeafe !important;
    }
    
    .total-payment-card {
        background-color: #f3f4f6 !important;
    }
    
    .calculator-card {
        background-color: #ffffff !important;
    }
    
    .result-card {
        background-color: #ffffff !important;
    }
    
    /* Remove transitions for print */
    .input-field, .calculate-btn, .nav-link {
        transition: none;
    }
}

/* Animation for loading states */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Focus styles for accessibility */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Cache control headers recommendation (to be implemented on server) */
/* 
Cache-Control: public, max-age=2592000 (1 month for CSS/JS)
Cache-Control: public, max-age=15552000 (6 months for images)
*/

/* Performance optimization: Reduce unused CSS */
/* Only include styles that are actually used on the page */