body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #0056b3;
    text-align: center;
    margin-bottom: 25px;
}

h2 {
    color: #0056b3;
    margin-top: 30px;
    margin-bottom: 15px;
}

form {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="number"],
select,
input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.form-col {
    flex: 1;
    min-width: 150px;
}

.form-col label {
    margin-bottom: 5px;
}
.form-col input, .form-col select {
    margin-bottom: 0;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.checkbox-group label {
    display: inline-flex;
    align-items: center;
    margin-right: 0;
    font-weight: normal;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
}

button[type="submit"] {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: auto;
}

button[type="submit"]:hover {
    background-color: #0056b3;
}

/* Daily Rates Display and Compounding Note */
#dailyRatesDisplay, .compounding-note {
    margin-top: 20px;
    padding: 10px;
    background-color: #f0f8ff;
    border: 1px solid #cceeff;
    border-radius: 5px;
    font-size: 0.9em;
}
#dailyRatesDisplay ul {
    list-style: none;
    padding: 0;
    margin: 5px 0 0;
}
#dailyRatesDisplay ul li {
    margin-bottom: 3px;
}
#dailyRatesDisplay h4 {
    margin-top: 0;
    margin-bottom: 5px;
    color: #0056b3;
}


/* Dynamic Deposit/Withdrawal Events */
#depositWithdrawalEvents {
    border: 1px dashed #007bff;
    padding: 15px;
    margin-top: 20px;
    border-radius: 5px;
    background-color: #e6f7ff;
}

.dw-event {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #b3e5fc;
    border-radius: 5px;
    background-color: #ffffff;
    align-items: flex-end;
}

.dw-event .form-col {
    flex: 1;
    min-width: 100px;
}
.dw-event .form-col.amount-col {
    flex-basis: 120px;
}
.dw-event .form-col.year-month-col {
    flex-basis: 120px;
}
.dw-event .form-col.frequency-col {
    flex-basis: 150px;
}


.dw-event button.remove-event {
    background-color: #dc3545;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    height: 38px;
    margin-bottom: 0;
    align-self: flex-end;
}
.dw-event button.remove-event:hover {
    background-color: #c82333;
}

button#addDepositWithdrawalEvent {
    background-color: #28a745;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 0.9em;
}
button#addDepositWithdrawalEvent:hover {
    background-color: #218838;
}


/* Chart container styling */
.chart-container {
    width: 100%;
    max-width: 1000px;
    max-height: 500px;
    margin: 30px auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}
.chart-container h2 {
    text-align: center;
}
.chart-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}


.plan-section {
    margin-top: 40px;
    border-top: 2px solid #eee;
    padding-top: 20px;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 30px;
}

.plan-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    min-width: 700px; /* Adjusted min-width for fewer columns */
}

.plan-table th, .plan-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.plan-table th {
    background-color: #f2f2f2;
    font-weight: bold;
    white-space: nowrap;
}

.plan-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.year-end-highlight {
    background-color: #e0f7fa !important;
    font-weight: bold;
}

.summary-for-rate {
    border: 1px solid #b3e5fc;
    background-color: #e1f5fe;
    padding: 15px;
    margin-top: 20px;
    border-radius: 5px;
}

.summary-for-rate h3 {
    color: #0277bd;
    margin-top: 0;
    margin-bottom: 10px;
}

.summary-for-rate ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.summary-for-rate ul li {
    margin-bottom: 5px;
}

.summary-for-rate ul li strong {
    color: #0056b3;
}


.download-all-buttons {
    margin-top: 30px;
    text-align: center;
    padding: 20px;
    border-top: 2px solid #007bff;
}

.download-all-buttons button {
    margin: 0 10px;
    padding: 12px 25px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 5px;
    border: none;
}

.download-all-buttons #downloadExcelBtn {
    background-color: #28a745;
    color: white;
}

.download-all-buttons #downloadExcelBtn:hover {
    background-color: #218838;
}

.download-all-buttons #downloadPdfBtn {
    background-color: #dc3545;
    color: white;
}

.download-all-buttons #downloadPdfBtn:hover {
    background-color: #c82333;
}


#customRateInput {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 15px;
    }
    h1 {
        font-size: 1.8rem;
    }
    .form-row {
        flex-direction: column;
    }
    .form-col {
        width: 100%;
        min-width: unset;
    }
    .checkbox-group {
        flex-direction: column;
        gap: 5px;
    }
    button[type="submit"] {
        width: 100%;
    }
    .download-all-buttons button {
        width: 100%;
        margin: 5px 0;
    }
    .summary-for-rate {
        padding: 10px;
    }
    .summary-for-rate h3 {
        font-size: 1.1rem;
    }
    .chart-container {
        padding: 10px;
        max-height: 400px;
    }
    .dw-event {
        flex-direction: column;
        align-items: stretch;
    }
    .dw-event .form-col {
        width: 100%;
        min-width: unset;
        flex-basis: auto;
    }
    .dw-event button.remove-event {
        width: 100%;
        margin-top: 10px;
    }
}