body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f7f6;
    margin: 0;
    padding: 0;
}

header {
    background: #007bff;
    color: #fff;
    padding: 1rem 0;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
}

/* Style for the ad section within the header */
header .ad-section {
    max-width: 728px; /* Limit the width of the ad container */
    max-height: 120px; /* Limit the height of the ad container */
    margin: 1rem auto 0; /* Add some space above and center it */
    padding: 0 1rem; /* Add horizontal padding for smaller screens */
    box-sizing: border-box;
    display: flex; /* Use flexbox for alignment */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
}

main {
    padding: 2rem;
}

#info-sidebar {
    display: none; /* Hide by default on mobile */
}

.container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.calc-mode-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    background-color: #e9ecef;
    padding: 0.5rem;
    border-radius: 8px;
}

.calc-mode-selector button {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    color: #495057;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
}

.calc-mode-selector button.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

.input-section, .result-section, .ad-section {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.ad-section {
    padding: 1rem;
    text-align: center;
}

.ad-section img, .sidebar-ad-section img {
    max-width: 100%;
    height: auto;
}

h2 {
    margin-top: 0;
    color: #007bff;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input[type="number"], input[type="checkbox"] {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

input[type="number"] {
    width: 100%;
    box-sizing: border-box;
}

.family-section, .bonus-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

#calculate-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

#calculate-btn:hover {
    background: #218838;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.6);
}

.calculation-message {
    display: none;
    margin-top: 1rem;
    text-align: center;
    color: #28a745;
    font-weight: bold;
}

.result-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
}

.result-item.total {
    font-weight: bold;
    font-size: 1.5rem;
    color: #007bff;
    margin-top: 1rem;
}

.result-item.monthly, .result-item.bonus {
    font-size: 1.2rem;
    color: #555;
    margin-top: 0.5rem;
}

.result-item.bonus {
    color: #28a745; /* Green to highlight bonus */
}

.disclaimer {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: #888;
    text-align: center;
    line-height: 1.5;
}

hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 1rem 0;
}

/* Desktop Layout */
@media (min-width: 1024px) {
    .page-wrapper {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 2rem;
        max-width: 1200px;
        margin: 0 auto;
    }

    #info-sidebar {
        display: block;
        background: #fff;
        padding: 2rem;
        border-radius: 8px;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
        height: fit-content;
    }

    #info-sidebar h2 {
        font-size: 1.5rem;
    }

    #info-sidebar .info-item {
        margin-bottom: 1.5rem;
    }

    #info-sidebar .info-item h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    #info-sidebar .info-item p {
        font-size: 0.95rem;
        color: #555;
    }

    .sidebar-ad-section {
        margin-top: 2rem;
        text-align: center;
    }

    main {
        padding: 2rem 1rem;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 1rem;
    }

    .input-section, .result-section {
        padding: 1.5rem;
    }

    .calc-mode-selector button {
        font-size: 0.9rem;
    }
}
