/* General Reset and Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f9;
    color: #333;
    line-height: 1.6;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.calculator-content {
    flex-grow: 1;
    max-width: 800px;
    background-color: #fff;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    margin: 0 20px; /* Space for side ads on desktop */
}

h1 {
    color: #007bff;
    font-size: 2em;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Calculator Panel Styling */
.calculator-panel {
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    background-color: #f9f9f9;
}

.toggle-switch {
    display: flex;
    margin-bottom: 20px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #007bff;
}

.toggle-switch button {
    flex-grow: 1;
    padding: 10px 15px;
    border: none;
    background-color: #fff;
    color: #007bff;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

.toggle-switch button.active {
    background-color: #007bff;
    color: #fff;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.input-group input, .input-group select {
    width: calc(100% - 20px);
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
}

.input-group input:focus, .input-group select:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    outline: none;
}

#calculate-btn {
    width: 100%;
    padding: 12px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s;
}

#calculate-btn:hover {
    background-color: #218838;
}

/* Results Section Styling */
.results-panel {
    margin-top: 20px;
    padding: 20px;
    border: 2px solid #28a745;
    border-radius: 8px;
    background-color: #e9ffe6; /* Light green background */
}

.results-panel h2 {
    color: #28a745;
    text-align: center;
    margin-top: 0;
}

.result-breakdown {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.result-box {
    text-align: center;
    padding: 15px;
    border-radius: 6px;
    flex: 1 1 30%; /* Flexible sizing */
    margin: 10px;
    min-width: 150px;
}

.result-box h3 {
    margin: 0 0 5px 0;
    font-size: 1em;
    font-weight: 500;
}

.result-box p {
    font-size: 1.8em;
    font-weight: bold;
    margin: 0;
}

.invested { background-color: #cce5ff; color: #004085; } /* Blue for Invested */
.returns { background-color: #fff3cd; color: #856404; } /* Yellow for Returns */
.final-value { background-color: #d4edda; color: #155724; } /* Green for Total Value */

/* About Section & FAQ Styling */
.about-section h2, .about-section h3 {
    color: #007bff;
    margin-top: 30px;
}

.faq-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
}

.faq-item {
    margin-bottom: 20px;
}

.faq-item h3 {
    color: #333;
    font-size: 1.1em;
    cursor: pointer;
    transition: color 0.3s;
}

.faq-item h3:hover {
    color: #007bff;
}

.faq-item p {
    padding-left: 20px;
    border-left: 3px solid #007bff;
}

/* Utility Class */
.hidden {
    display: none;
}

/* AdSense Placeholders Styling */
.ad-placeholder {
    background-color: #e8e8e8;
    color: #666;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    margin: 10px 0;
    border: 1px dashed #aaa;
}

.top-ad, .bottom-ad {
    width: 100%;
    height: 90px;
    max-width: 728px;
    margin: 10px auto;
}

.left-ad, .right-ad {
    width: 160px;
    height: 600px;
    /* Hide on mobile/tablet to save space */
    display: none; 
}

/* Media Queries for Responsiveness */
@media (min-width: 1024px) {
    .main-container {
        display: flex;
        justify-content: space-between;
    }
    .left-ad, .right-ad {
        display: flex; /* Show side ads on wider screens */
        margin: 0;
    }
    .calculator-content {
        margin: 0 10px; /* Tighter spacing for three-column layout */
    }
}

@media (max-width: 600px) {
    .calculator-content {
        padding: 15px;
        margin: 0;
        width: 100%;
    }
    .result-breakdown {
        flex-direction: column;
    }
    .result-box {
        flex: 1 1 100%;
        margin-bottom: 10px;
    }
    h1 {
        font-size: 1.5em;
    }
}