/* CSS Custom Properties for Performance */
:root {
    --primary-color: #204080;
    --primary-light: rgba(32, 64, 128, 0.08);
    --text-color: #333;
    --text-muted: #666;
    --background: #ffffff;
    --surface: #f8f9fa;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-light: 0 2px 20px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 4px 24px rgba(0, 0, 0, 0.08);
    --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --border-radius: 8px;
    --border-radius-large: 16px;
    --transition: all 0.2s ease;
}

/* Performance-optimized base styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-system);
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background);
    font-display: swap;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header Design */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 70px;
}

.logo a {
    font-size: 26px;
    font-weight: 700;
    color: #204080;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 12px;
    align-items: center;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 14px 18px;
    border-radius: 10px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active {
    color: #204080;
    background: rgba(32, 64, 128, 0.08);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    min-width: 250px;
    padding: 12px;
    margin-top: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: #333;
    font-size: 15px;
    border-radius: 8px;
    margin: 2px 0;
}

.dropdown-menu a:hover {
    background: rgba(32, 64, 128, 0.08);
    color: #204080;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #204080;
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
}

/* Breadcrumb */
.breadcrumb {
    background: #f8f9fa;
    padding: 20px 0;
}

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

.breadcrumb ul {
    list-style: none;
    display: flex;
    gap: 8px;
    align-items: center;
}

.breadcrumb a {
    color: #204080;
    text-decoration: none;
    font-size: 14px;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #666;
    font-size: 14px;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    padding: 80px 0;
    text-align: center;
}

.page-header .container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

.page-title {
    font-size: 48px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
    line-height: 1.1;
    letter-spacing: -1px;
}

.page-subtitle {
    font-size: 22px;
    color: #204080;
    margin-bottom: 16px;
    font-weight: 600;
}

.page-description {
    font-size: 18px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    align-items: start;
}

/* Calculator Layout */
.calculator-layout {
    display: block;
    width: 100%;
}

/* Calculator Section */
.calculator-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.calculator-title {
    font-size: 28px;
    font-weight: 700;
    color: #204080;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.calculator-subtitle {
    color: #666;
    margin-bottom: 32px;
    font-size: 16px;
}

.form-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 32px;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #204080;
    margin-bottom: 8px;
    font-size: 16px;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #204080;
    box-shadow: 0 0 0 4px rgba(32, 64, 128, 0.1);
}

.currency-input {
    padding-left: 45px;
}

.percentage-input {
    padding-right: 45px;
}

.currency-symbol, .percentage-symbol {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-weight: 600;
    font-size: 16px;
}

.currency-symbol {
    left: 16px;
}

.percentage-symbol {
    right: 16px;
}

.button-group {
    display: flex;
    gap: 16px;
}

.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #204080 0%, #3366cc 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(32, 64, 128, 0.25);
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e5e5e5;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

/* Results Section */
.results-section {
    display: block;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    border-radius: 16px;
    padding: 32px;
    margin-top: 32px;
}

.results-title {
    font-size: 24px;
    font-weight: 700;
    color: #204080;
    margin-bottom: 24px;
    text-align: center;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.result-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.result-card h3 {
    color: #666;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 28px;
    font-weight: 700;
    color: #204080;
    margin-bottom: 4px;
}

/* Results Content Layout */
.results-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.main-result {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    border-radius: 16px;
    border: 2px solid #204080;
}

.result-label {
    font-size: 16px;
    color: #666;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 36px;
    font-weight: 700;
    color: #204080;
}

.secondary-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.result-item:hover {
    border-color: #204080;
    box-shadow: 0 4px 12px rgba(32, 64, 128, 0.1);
}

.result-item .label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.result-item .value {
    font-size: 18px;
    font-weight: 700;
    color: #204080;
}

.affordability-breakdown {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
}

.affordability-breakdown h3 {
    font-size: 20px;
    font-weight: 700;
    color: #204080;
    margin-bottom: 20px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item .label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.breakdown-item .value {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 100px;
}

.info-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 32px;
}

.info-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: #204080;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.info-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
    position: relative;
    padding-left: 20px;
}

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

.info-list li:before {
    content: "•";
    color: #204080;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.related-card {
    display: block;
    background: #f8f9ff;
    border-radius: 8px;
    padding: 16px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    text-align: center;
    border: 2px solid transparent;
}

.related-card:hover {
    border-color: #204080;
    transform: translateY(-2px);
}

.related-card i {
    color: #204080;
    font-size: 20px;
    margin-bottom: 8px;
}

.related-card span {
    font-weight: 600;
    font-size: 13px;
    display: block;
}

/* Next Steps Action Buttons */
.next-steps h3 {
    font-size: 20px;
    font-weight: 700;
    color: #204080;
    margin-bottom: 20px;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #f8f9ff;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: center;
    justify-content: center;
}

.action-button:hover {
    border-color: #204080;
    background: white;
    color: #204080;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.action-button i {
    color: #204080;
    font-size: 18px;
}

/* Info Section Layout */
.info-section {
    margin-top: 60px;
}

.row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.col-md-6 {
    /* Grid item - no specific styling needed */
}

/* FAQ Section */
.faq-section {
    max-width: 1200px;
    margin: 80px auto 0;
    padding: 0 24px;
}

.faq-header {
    text-align: center;
    margin-bottom: 48px;
}

.faq-title {
    font-size: 36px;
    font-weight: 700;
    color: #204080;
    margin-bottom: 12px;
}

.faq-subtitle {
    color: #666;
    font-size: 18px;
}

.faq-container {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.faq-item {
    border-bottom: 1px solid #f0f0f0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.faq-question:hover {
    color: #204080;
}

.faq-question h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.faq-question i {
    color: #204080;
    transition: transform 0.2s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 200px;
}

.faq-answer p {
    padding: 0 0 24px 0;
    color: #666;
    line-height: 1.6;
}

/* Footer */
.main-footer {
    background: #1a1a1a;
    color: white;
    padding: 60px 0 30px 0;
    margin-top: 80px;
}

.main-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    color: #204080;
    margin-bottom: 20px;
    font-size: 20px;
}

.footer-section p {
    color: #ccc;
    line-height: 1.6;
}

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

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-section ul li a:hover {
    color: #204080;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 30px;
    text-align: center;
    color: #999;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        padding: 12px 0;
        border-radius: 0;
        border-bottom: 1px solid #eee;
        width: 100%;
    }
    
    .page-title {
        font-size: 36px;
    }
    
    .main-content {
        padding: 40px 20px;
    }
    
    .calculator-container {
        padding: 24px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }

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

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .row {
        grid-template-columns: 1fr;
        gap: 24px;
    }

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

    .main-result .result-value {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 28px;
    }
    
    .calculator-title {
        font-size: 24px;
    }
    
    .form-input {
        padding: 14px 16px;
    }
    
    .currency-input {
        padding-left: 40px;
    }
    
    .percentage-input {
        padding-right: 40px;
    }
} 