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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Header and Navigation */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.nav-logo h2 {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
}

.nav-logo i {
    margin-right: 10px;
    color: #ffd700;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.nav-link:hover {
    color: #ffd700;
    background-color: rgba(255,255,255,0.1);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 150px 0 100px;
    margin-top: 80px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.3rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto 2rem;
}

/* Hero Features */
.hero-features {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.feature-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.feature-badge:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Calculator Sections */
.calculator-section {
    padding: 80px 0;
}

.calculator-section:nth-child(even) {
    background-color: white;
}

.calculator-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.calculator-section h2 i {
    margin-right: 15px;
    color: #667eea;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.calculator-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.calculator-card i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.calculator-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.calculator-card p {
    color: #666;
    font-size: 0.95rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    padding: 20px;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #667eea;
}

#calculatorContainer {
    padding: 2rem;
}

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

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-full {
    width: 100%;
    margin-top: 1rem;
}

.result-section {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    margin-top: 2rem;
    border-left: 4px solid #667eea;
}

.result-section h3 {
    color: #333;
    margin-bottom: 1rem;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

/* Scientific Calculator Styles */
.scientific-calculator {
    max-width: 400px;
    margin: 20px auto;
    background: #2d3748;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.calculator-display {
    background: #1a202c;
    color: #e2e8f0;
    font-size: 2rem;
    font-family: 'Courier New', monospace;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: right;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.calc-btn {
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 50px;
}

.calc-btn.number {
    background: #4a5568;
    color: white;
}

.calc-btn.number:hover {
    background: #5a6578;
    transform: translateY(-2px);
}

.calc-btn.operator {
    background: #667eea;
    color: white;
}

.calc-btn.operator:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.calc-btn.function {
    background: #ed8936;
    color: white;
}

.calc-btn.function:hover {
    background: #dd7324;
    transform: translateY(-2px);
}

/* BMI Chart Styles */
.bmi-chart {
    margin: 20px 0;
    text-align: center;
}

.bmi-scale {
    display: flex;
    border-radius: 25px;
    overflow: hidden;
    margin: 20px 0;
    height: 50px;
    position: relative;
}

.bmi-range {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
    padding: 10px 5px;
}

.bmi-range.underweight {
    background: #3182ce;
}

.bmi-range.normal {
    background: #38a169;
}

.bmi-range.overweight {
    background: #d69e2e;
}

.bmi-range.obese {
    background: #e53e3e;
}

.bmi-indicator {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 15px solid #333;
    margin: 0 auto;
    position: relative;
    transition: all 0.3s ease;
}

/* Fraction Calculator Styles */
.fraction-input {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #e9ecef;
}

.fraction-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.fraction-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 10px;
}

.fraction-numerator,
.fraction-denominator {
    width: 60px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.fraction-line {
    width: 60px;
    height: 2px;
    background: #333;
    margin: 2px 0;
}

/* Course Row Styles for GPA Calculator */
.course-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr auto;
    gap: 10px;
    align-items: center;
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.course-name,
.course-credits,
.course-grade {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.remove-course {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.remove-course:hover {
    background: #c82333;
}

/* Password Generator Styles */
.password-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.option-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.checkbox-group input[type="checkbox"] {
    transform: scale(1.2);
}

.password-display {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    word-break: break-all;
    margin: 15px 0;
    min-height: 50px;
    display: flex;
    align-items: center;
}

.copy-btn {
    background: #38a169;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
}

.copy-btn:hover {
    background: #2f855a;
}

/* Unit Converter Styles */
.converter-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: end;
    margin: 20px 0;
}

.converter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.converter-group label {
    font-weight: 600;
    color: #4a5568;
}

.converter-group input,
.converter-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.swap-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn:hover {
    background: #5a67d8;
    transform: rotate(180deg);
}

/* Search Container */
.search-container {
    margin: 2rem 0;
    position: relative;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-box {
    display: flex;
    background: white;
    border-radius: 30px;
    padding: 0.75rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border: 2px solid #e0e0e0;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 25px;
    background: transparent;
}

.search-box input::placeholder {
    color: #666;
    font-weight: 400;
}

.search-box button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    font-weight: 500;
}

.search-box button:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.search-result {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result:hover {
    background: #f8f9fa;
}

.search-result:last-child {
    border-bottom: none;
}

.result-name {
    font-weight: bold;
    color: #333;
}

.result-category {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
}

.no-results {
    padding: 1rem;
    text-align: center;
    color: #666;
}

/* FAQ Section Styles */
.faq-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

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

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.faq-item {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.faq-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.faq-question {
    font-size: 1.2em;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.faq-question i {
    margin-right: 10px;
    color: #667eea;
}

.faq-answer {
    color: #4a5568;
    line-height: 1.6;
}

/* USA-Specific Calculator Styles */
.usa-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.badge-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.badge-success {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    color: white;
}

.usa-rates-info {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 25px;
    border-radius: 12px;
    margin-top: 30px;
    border-left: 4px solid #667eea;
}

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

.rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rate-type {
    font-weight: 600;
    color: #2d3748;
}

.rate-value {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1em;
}

.disclaimer {
    font-size: 0.9em;
    color: #718096;
    font-style: italic;
    margin-top: 15px;
    text-align: center;
}

/* Enhanced Input Sections */
.input-section h3 {
    color: #2d3748;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Enhanced Payment Display */
.payment-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.monthly-payment {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.payment-label {
    font-size: 1.1em;
    opacity: 0.9;
    margin-bottom: 10px;
}

.payment-amount {
    font-size: 2.5em;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Enhanced Breakdown Section */
.breakdown-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.breakdown-grid {
    display: grid;
    gap: 15px;
}

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

.breakdown-item.total {
    border-top: 2px solid #667eea;
    border-bottom: none;
    font-weight: 700;
    font-size: 1.1em;
    color: #2d3748;
    margin-top: 10px;
    padding-top: 15px;
}

.breakdown-item span:first-child {
    color: #4a5568;
    font-weight: 500;
}

.breakdown-item span:last-child {
    color: #2d3748;
    font-weight: 600;
}

/* Tax Calculator Specific Styles */
.tax-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.summary-value {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 8px;
}

.summary-label {
    font-size: 0.9em;
    opacity: 0.9;
}

.tax-brackets-info {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 30px 0;
}

.brackets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.bracket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.bracket-range {
    font-weight: 600;
    color: #2d3748;
}

.bracket-rate {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1em;
}

/* Retirement Calculator Styles */
.retirement-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.limits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.limit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #38a169;
}

.limit-type {
    font-weight: 600;
    color: #2d3748;
}

.limit-value {
    font-weight: 700;
    color: #38a169;
    font-size: 1.1em;
}

.contribution-limits {
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
    padding: 30px;
    border-radius: 12px;
    margin: 30px 0;
    border-left: 4px solid #38a169;
}

/* Auto Loan Calculator Styles */
.auto-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Investment Calculator Styles */
.investment-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.investment-tips, .auto-tips, .tax-tips, .retirement-tips {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.investment-tips h4, .auto-tips h4, .tax-tips h4, .retirement-tips h4 {
    color: #2d3748;
    margin-bottom: 15px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.investment-tips ul, .auto-tips ul, .tax-tips ul, .retirement-tips ul {
    list-style: none;
    padding: 0;
}

.investment-tips li, .auto-tips li, .tax-tips li, .retirement-tips li {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
    line-height: 1.5;
}

.investment-tips li:last-child, .auto-tips li:last-child, 
.tax-tips li:last-child, .retirement-tips li:last-child {
    border-bottom: none;
}

/* Salary Calculator Styles */
.salary-conversions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.conversion-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.conversion-value {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 8px;
}

.conversion-label {
    font-size: 0.9em;
    opacity: 0.9;
}

.salary-tips {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.salary-tips h4 {
    color: #2d3748;
    margin-bottom: 15px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.salary-tips ul {
    list-style: none;
    padding: 0;
}

.salary-tips li {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
    line-height: 1.5;
}

.salary-tips li:last-child {
    border-bottom: none;
}

/* Footer */
footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

.footer-section h3 {
    color: #4CAF50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

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

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section ul li a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 400;
    line-height: 1.6;
}

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

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 1.5rem;
    text-align: center;
    color: #ecf0f1;
    line-height: 1.6;
}

/* Legal Pages */
.legal-page {
    padding: 2rem 0;
    min-height: 70vh;
}

.legal-page h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.legal-page h2 {
    color: #4CAF50;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.legal-page section {
    margin-bottom: 2rem;
}

.legal-page ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.legal-page ul li {
    margin-bottom: 0.5rem;
}

/* Popular Searches */
.popular-searches {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.popular-searches span {
    color: #666;
    margin-right: 1rem;
}

.popular-searches a {
    color: #4CAF50;
    text-decoration: none;
    margin: 0 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    background: rgba(76, 175, 80, 0.1);
    transition: all 0.3s;
}

.popular-searches a:hover {
    background: #4CAF50;
    color: white;
}

/* Breadcrumb Navigation */
.breadcrumb {
    background: #f8f9fa;
    padding: 1rem 0;
    border-bottom: 1px solid #dee2e6;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: #4CAF50;
    text-decoration: none;
}

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

.breadcrumb-item:not(:last-child)::after {
    content: ">";
    margin: 0 0.5rem;
    color: #6c757d;
}

/* Performance Optimizations */
.calculator-card {
    will-change: transform;
}

.search-results {
    will-change: opacity;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    color: white;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.stat-item i {
    color: #4CAF50;
}

/* Footer Links */
.footer-links {
    margin-top: 1.5rem;
    font-size: 0.95rem;
}

.footer-links a {
    color: #ecf0f1;
    text-decoration: none;
    margin: 0 0.5rem;
    font-weight: 400;
}

.footer-links a:hover {
    color: #4CAF50;
    text-decoration: underline;
}

/* Breadcrumb Navigation */
.breadcrumb {
    background: #f8f9fa;
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #4CAF50;
    text-decoration: none;
}

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

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: #666;
}

.breadcrumb-current {
    color: #666;
    font-weight: 500;
}

/* Mobile Menu Body Lock */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background: rgba(102, 126, 234, 0.98);
        width: 100%;
        height: calc(100vh - 80px);
        text-align: center;
        transition: left 0.3s ease-in-out;
        backdrop-filter: blur(15px);
        padding: 2rem 0;
        z-index: 999;
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu .nav-link {
        display: block;
        padding: 1.5rem 2rem;
        margin: 0.5rem 0;
        font-size: 1.2rem;
        border-radius: 10px;
        margin-left: 1rem;
        margin-right: 1rem;
        transition: all 0.3s ease;
    }

    .nav-menu .nav-link:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateX(10px);
    }

    .hamburger {
        display: flex;
        z-index: 1001;
        position: relative;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .calculator-section h2 {
        font-size: 2rem;
    }

    .calculator-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .calculator-buttons {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media screen and (max-width: 480px) {
    .hero {
        padding: 120px 0 80px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .calculator-section {
        padding: 60px 0;
    }

    .calculator-card {
        padding: 1.5rem;
    }

    .nav-logo h2 {
        font-size: 1.4rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

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

.slide-up {
    animation: slideUp 0.5s ease-out;
}

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

/* Enhanced visualization styles */
.chart-container {
    width: 100%;
    height: 300px;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.visual-indicator {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    margin: 5px;
    text-align: center;
}

.indicator-excellent {
    background-color: #28a745;
    color: white;
}

.indicator-good {
    background-color: #17a2b8;
    color: white;
}

.indicator-normal {
    background-color: #ffc107;
    color: #212529;
}

.indicator-warning {
    background-color: #fd7e14;
    color: white;
}

.indicator-danger {
    background-color: #dc3545;
    color: white;
}

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

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

.calculation-steps {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #667eea;
}

.calculation-steps h4 {
    color: #667eea;
    margin-bottom: 15px;
}

.calculation-step {
    margin: 10px 0;
    padding: 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.formula-display {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    margin: 15px 0;
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.comparison-table th,
.comparison-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.comparison-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.comparison-table tr:hover {
    background-color: #f8f9fa;
}

.visual-scale {
    display: flex;
    align-items: center;
    margin: 15px 0;
}

.scale-bar {
    flex: 1;
    height: 8px;
    background: linear-gradient(90deg, #28a745 0%, #ffc107 50%, #dc3545 100%);
    border-radius: 4px;
    margin: 0 10px;
    position: relative;
}

.scale-marker {
    position: absolute;
    top: -5px;
    width: 18px;
    height: 18px;
    background: #333;
    border-radius: 50%;
    transform: translateX(-50%);
}

.info-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    color: #667eea;
    margin-left: 5px;
}

.info-tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
}

.info-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.result-breakdown {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border: 1px solid #dee2e6;
}

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

.breakdown-item:last-child {
    border-bottom: none;
    font-weight: bold;
    font-size: 1.1rem;
    color: #667eea;
}

.animated-counter {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    text-align: center;
    margin: 20px 0;
}

.gauge-container {
    width: 200px;
    height: 100px;
    margin: 20px auto;
    position: relative;
}

.gauge-background {
    width: 100%;
    height: 100%;
    border: 8px solid #e9ecef;
    border-bottom: 8px solid transparent;
    border-radius: 100px 100px 0 0;
    position: relative;
}

.gauge-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 8px solid #667eea;
    border-bottom: 8px solid transparent;
    border-radius: 100px 100px 0 0;
    transform-origin: center bottom;
    transition: transform 0.5s ease;
}

.gauge-label {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: bold;
    color: #667eea;
}

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

.fade-in-animation {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Enhanced responsive design for visualizations */
@media (max-width: 768px) {
    .chart-container {
        height: 250px;
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .gauge-container {
        width: 150px;
        height: 75px;
    }
    
    .animated-counter {
        font-size: 2rem;
    }
    
    .comparison-table {
        font-size: 0.9rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 8px 10px;
    }
}

/* Mortgage Calculator Specific Styles */
.payment-display {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.monthly-payment {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.payment-label {
    font-size: 1.2rem;
    opacity: 0.9;
}

.payment-amount {
    font-size: 3rem;
    font-weight: bold;
}

.breakdown-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.breakdown-section h4 {
    color: #667eea;
    margin-bottom: 20px;
}

.breakdown-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

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

.breakdown-item.total {
    font-weight: bold;
    font-size: 1.1rem;
    color: #667eea;
    border-top: 2px solid #667eea;
    margin-top: 10px;
    padding-top: 15px;
}

/* Amortization Table Styles */
.amortization-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-top: 40px;
}

.amortization-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.amortization-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9rem;
}

.amortization-table th {
    background: #667eea;
    color: white;
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.amortization-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e9ecef;
    text-align: right;
}

.amortization-table td:first-child,
.amortization-table td:nth-child(2) {
    text-align: left;
}

.amortization-table tbody tr:hover {
    background-color: #f8f9fa;
}

.amortization-table tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

/* Logo link styling */
.nav-logo a {
    text-decoration: none;
    color: inherit;
}

.nav-logo a:hover {
    text-decoration: none;
}

/* Enhanced responsive design for mortgage calculator */
@media (max-width: 768px) {
    .payment-amount {
        font-size: 2.5rem;
    }
    
    .breakdown-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .amortization-table {
        font-size: 0.8rem;
    }
    
    .amortization-table th,
    .amortization-table td {
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    .payment-amount {
        font-size: 2rem;
    }
    
    .amortization-section {
        padding: 20px 15px;
    }
    
    .table-container {
        margin: 0 -15px;
    }
}

/* Calculator Page Styles */
.calculator-page {
    padding-top: 100px;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.calculator-header {
    text-align: center;
    margin-bottom: 40px;
}

.calculator-header h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 10px;
}

.calculator-header p {
    font-size: 1.2rem;
    color: #6c757d;
}

.calculator-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.calculator-input {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.calculator-results {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.input-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.result-header h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
}

/* BMI Display Styles */
.bmi-display {
    text-align: center;
    margin: 30px 0;
}

.bmi-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.bmi-number {
    font-size: 4rem;
    font-weight: bold;
    color: #667eea;
}

.bmi-unit {
    font-size: 1.2rem;
    color: #6c757d;
}

.bmi-category {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
}

.bmi-category.underweight {
    background: #3182ce;
    color: white;
}

.bmi-category.normal {
    background: #38a169;
    color: white;
}

.bmi-category.overweight {
    background: #d69e2e;
    color: white;
}

.bmi-category.obese {
    background: #e53e3e;
    color: white;
}

/* BMI Chart Container */
.bmi-chart-container {
    height: 300px;
    margin: 30px 0;
    position: relative;
}

/* BMI Scale Visual */
.bmi-scale-visual {
    margin: 30px 0;
}

.scale-container {
    position: relative;
}

.scale-bar {
    display: flex;
    height: 60px;
    border-radius: 30px;
    overflow: hidden;
    margin-bottom: 20px;
}

.scale-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
}

.scale-section.underweight {
    background: #3182ce;
}

.scale-section.normal {
    background: #38a169;
}

.scale-section.overweight {
    background: #d69e2e;
}

.scale-section.obese {
    background: #e53e3e;
}

.bmi-pointer {
    position: absolute;
    top: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 15px solid #333;
    transform: translateX(-50%);
    transition: left 0.5s ease;
}

/* Health Info Section */
.health-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid #667eea;
}

.health-info h4 {
    color: #667eea;
    margin-bottom: 15px;
}

.recommendations ul {
    margin: 15px 0;
    padding-left: 20px;
}

.recommendations li {
    margin: 8px 0;
    color: #495057;
}

/* Info Section */
.info-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-top: 40px;
}

.info-section h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.bmi-categories {
    margin-top: 20px;
}

.bmi-categories h4 {
    color: #495057;
    margin-bottom: 15px;
}

.bmi-categories ul {
    list-style: none;
    padding: 0;
}

.bmi-categories li {
    background: #f8f9fa;
    margin: 10px 0;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

/* Button Styles */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Responsive Design for Calculator Pages */
@media (max-width: 768px) {
    .calculator-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .calculator-header h1 {
        font-size: 2rem;
    }
    
    .bmi-number {
        font-size: 3rem;
    }
    
    .calculator-input,
    .calculator-results {
        padding: 20px;
    }
    
    .scale-section {
        font-size: 0.8rem;
    }
    
    .bmi-chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .calculator-page {
        padding-top: 80px;
    }
    
    .calculator-header h1 {
        font-size: 1.8rem;
    }
    
    .bmi-number {
        font-size: 2.5rem;
    }
    
    .calculator-input,
    .calculator-results,
    .info-section {
        padding: 15px;
    }
}
