body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: #1e3474;
    color: #333;
}

/* Navbar */
.navbar {
    background-color: rgb(75, 81, 169);
    padding: 10px 20px;
    color: white;
    /* Ensure text color is white */
}

.navbar a.navbar-brand {
    color: white;
    /* Ensure brand text color is white */
}

.navbar-brand img {
    border-radius: 5px;
    color: white;
}

/* Header */
header {
    padding: 20px 0;
    text-align: center;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
}

.card-1 {
    padding: 20px;
}

#card-1-div {
    background: linear-gradient(90deg, #007bff, #0056b3);
    border: 1px solid #000000;
    border-radius: 10px;
    padding: 20px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 1.0);
}

/* Main */
main {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* Form and Display */
.form-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

#information {
    background: linear-gradient(90deg, #007bff, #0056b3);
    color: white;
    border: 1px solid #000000;
    border-radius: 10px;
    padding: 20px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 1.0);
    text-align: center;
    width: 40%;
    margin: auto;
    font-size: 1.2rem;
}

/* Material Icons */
.material-symbols-outlined {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    gap: 5px;
    font-variation-settings:
        'FILL'0,
        'wght'400,
        'GRAD'0,
        'opsz'20;
}

.h2-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.h2-header .popuptext {
    font-size: 1.2rem;
}

.popup {
    position: relative;
    display: inline-block;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* The actual popup */
.popup .popuptext {
    visibility: hidden;
    width: 160px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -80px;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Popup arrow */
.popup .popuptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

/* Toggle this class - hide and show the popup */
.popup:hover .popuptext {
    visibility: visible;
    opacity: 1;
}

/* Add animation (fade in the popup) */
@-webkit-keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}
/* Budget goals */
#budget-goals-display {
    background: linear-gradient(90deg, #007bff, #0056b3);
    color: #333;
    border: 1px solid #000000;
    border-radius: 10px;
    padding: 20px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 1.0);
    text-align: center;
    margin: 10px 150px 20px;
    max-width: 800px;
    margin: 10px auto 20px;
}

#budget-goals-display h2 {
    color: white;
    margin-bottom: 10px;
}

#budget-goals-list {
    list-style-type: none;
    padding: 0;
}

#budget-goals-list li {
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: none;
}

.budget-goal-item {
    background: #ffffff;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.budget-goal-item h4 {
    margin-bottom: 8px;
    color: #333;
    text-transform: capitalize;
    font-size: 1rem;
}

.budget-goal-item p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.budget-goal-item .progress {
    height: 15px;
    margin: 8px 0;
    background-color: #e9ecef;
    border-radius: 4px;
}

.budget-goal-item .progress-bar {
    font-size: 10px;
    line-height: 15px;
    font-weight: bold;
}

.budget-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.budget-actions button {
    min-width: 60px;
    padding: 4px 8px;
    font-size: 0.8rem;
}
/* Input section */
#inputs {
    margin-bottom: 30px;
}

form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

form input,
form select,
form button {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

form input:focus,
form button:hover {
    border-color: #007bff;
    outline: none;
    background-color: #eef6ff;
}

form button {
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    width: auto;
    border: 1px solid #000;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 1.0);
}

form button:hover {
    background: #0056b3;
}

/* Add Bootstrap validation styling */
.form-control.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

.was-validated .form-control:invalid~.invalid-feedback {
    display: block;
}

/* Summary section */
#summary {
    background: linear-gradient(90deg, #007bff, #0056b3);
    color: white;
    border: 1px solid #000000;
    border-radius: 10px;
    padding: 20px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 1.0);
    text-align: center;
    margin: 10px 150px 20px;
}

#summary p {
    font-size: 1.2rem;
    font-weight: bold;
}

#summary .highlight {
    color: #007bff;
}

/* Savings section */
#savings-section {
    margin: 30px 0;
    text-align: center;
}

#savings-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

#savings-section input,
#savings-section button {
    width: auto;
    padding: 10px;
    margin-right: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

#savings-section input:focus,
#savings-section button:hover {
    border-color: #007bff;
    outline: none;
    background-color: #eef6ff;
}

#savings-section button {
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    border: 1px solid #000;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 1.0);
}

#savings-section button:hover {
    background: #0056b3;
}

/* Budget Goals */
#budget-goals {
    background: linear-gradient(90deg, #007bff, #0056b3);
    color: white;
    border: 1px solid #000000;
    border-radius: 10px;
    padding: 20px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 1.0);
    text-align: center;
    margin: 10px 150px 20px;
}

#budget-goals label,
#budget-goals select,
#budget-goals input,
#budget-goals button {
    display: block;
    margin: 10px auto;
    width: 80%;
    max-width: 400px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

#budget-goals input:focus,
#budget-goals button:hover {
    border-color: #007bff;
    outline: none;
    background-color: #eef6ff;
}

#budget-goals button {
    background: #007bff;
    color: white;
    border: 1px solid #000;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 1.0);
    cursor: pointer;
}

#budget-goals button:hover {
    background: #0056b3;
}

#budget-goals-form {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

#budget-goals-form .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

#budget-goals-form label {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: white;
    display: block;
}

#budget-goals-form .form-control {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    transition: all 0.3s ease;
}

#budget-goals-form .form-control:focus {
    border-color: #fff;
    background-color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

#budget-goals-form select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

#budget-goals-form #save-budget {
    width: 100%;
    padding: 12px;
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: #fff;
    color: #007bff;
    border: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

#budget-goals-form #save-budget:hover {
    background: #e6e6e6;
    transform: translateY(-1px);
}

.budget-table,
.budget-header,
.budget-row {
    display: none;
}

#budget-goals-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
}

#budget-goals-table th {
    background-color: #007bff;
    color: white;
    border: 1px solid #000;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 1.0);
    padding: 12px;
    text-align: center;
}

#budget-goals-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    text-transform: capitalize;
}

#budget-goals-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

#budget-goals-table tr:hover {
    background-color: #eef6ff;
}

#budget-goals-table .progress-cell {
    min-width: 150px;
    padding: 10px;
}

#budget-goals-table .progress {
    margin: 0;
    height: 20px;
}


/* Charts */
#charts-container {
    display: flex;
    justify-content: space-around;
    margin-top: 40px;
}

canvas {
    max-width: 400px;
    max-height: 400px;
}

/* Expense List */
#expense-list {
    margin: 30px 0;
    text-align: center;
}

#expense-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

#expense-table th {
    border: 1px solid #000;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 1.0);
}

#expense-table th,
#expense-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

#expense-table th {
    background-color: #007bff;
    color: white;
}

#expense-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

#expense-table tr:hover {
    background-color: #eef6ff;
}

#expense-table .income {
    color: green;
}

#expense-table .expense {
    color: red;
}

#expense-table td {
    text-transform: capitalize;
}

/* Update expense table buttons */
.edit-expense,
.delete-expense {
    padding: 4px 8px;
    font-size: 0.8rem;
    margin: 0 2px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-width: 60px;
}

.edit-expense {
    background-color: #0d6efd;
    color: white;
    border: 1px solid #0a58ca;
}

.delete-expense {
    background-color: #dc3545;
    color: white;
    border: 1px solid #b02a37;
}

.edit-expense:hover {
    background-color: #0b5ed7;
}

.delete-expense:hover {
    background-color: #bb2d3b;
}

#expense-table td:last-child {
    padding: 4px;
}

/* Reset Button */
#reset-box {
    margin-top: 20px;
    text-align: center;
}

#reset {
    background-color: #dc3545;
    color: white;
    border: 1px solid #000;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 1.0);
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 5px;

}

#reset:hover {
    background-color: #bd2130;
}

/* Add styles for savings form */
#savings-form {
    border-top: 1px solid #ddd;
    padding-top: 1rem;
    margin-top: 1rem;
}

#savings-form .form-group {
    margin-bottom: 1rem;
}

/* Add styles for budget goals form */
#budget-goals-form .form-group {
    margin-bottom: 1rem;
}

#budget-goals-form .form-control {
    max-width: 100%;
    margin: 0 auto 1rem;
}

/* Budget Goals Overview Responsive Styles */
.budget-table {
    width: 100%;
    background: #ffffff;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.budget-header,
.budget-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 2fr 1fr;
}


/* Media Queries */

/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {
    #charts-container {
        flex-direction: column-reverse;
    }

    #summary,
    #budget-goals-display,
    #information,
    #budget-goals,
    #savings-section,
    #expense-list {
        width: auto;
        margin: 10px;
        padding: 15px;
    }

    #budget-goals-table,
    #budget-goals-table tbody,
    #budget-goals-table tr,
    #budget-goals-table td {
        display: block;
    }

    #budget-goals-table thead {
        display: none;
    }

    #budget-goals-table tr {
        margin-bottom: 1rem;
        border: 1px solid #ddd;
        border-radius: 8px;
        background: #fff;
        padding: 8px;
    }

    #budget-goals-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px;
        border: none;
        border-bottom: 1px solid #eee;
    }

    #budget-goals-table td:last-child {
        border-bottom: none;
    }

    #budget-goals-table td::before {
        content: attr(data-label);
        font-weight: bold;
        margin-right: 1rem;
        min-width: 100px;
        text-align: left;
    }

    #budget-goals-table .progress-cell {
        flex-direction: column;
        align-items: stretch;
    }

    #budget-goals-table .progress-cell::before {
        margin-bottom: 8px;
        align-self: flex-start;
    }

    #budget-goals-table .progress {
        width: 100%;
    }

    .form-section {
        flex-direction: column;
        padding: 10px;
    }

    #expense-table {
        margin: 20px -20px;
        font-size: 0.9rem;
    }

    #expense-table th,
    #expense-table td {
        padding: 6px 4px;
    }

    #expense-table td:nth-child(3) {
        font-size: 0.8rem;
        min-width: 70px;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .edit-expense,
    .delete-expense {
        padding: 4px 8px;
        margin: 2px;
        font-size: 0.8rem;
        width: auto;
        min-width: 50px;
    }

    #expense-table td:last-child {
        white-space: nowrap;
    }
}

/* Medium devices (tablets, 768px and down) */
@media screen and (max-width: 768px) {

    #charts-container {
        flex-direction: column;
        align-items: center;
    }

    #budget-goals-display {
        margin: 10px;
        padding: 10px;
        width: auto;
    }

    .budget-table {
        font-size: 0.9rem;
    }

    .budget-row {
        display: flex;
        flex-direction: column;
        padding: 12px;
        margin-bottom: 12px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .budget-header {
        display: none;
    }

    .budget-row div {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid #eee;
    }

    .budget-row div:last-child {
        border-bottom: none;
    }

    .budget-row div::before {
        content: attr(data-label);
        font-weight: bold;
        margin-right: 8px;
        color: #666;
    }

    .progress-cell {
        flex-direction: column;
        align-items: stretch !important;
    }

    .progress-cell::before {
        margin-bottom: 8px;
    }

    .progress {
        width: 100%;
        margin: 4px 0;
    }

    .budget-actions {
        justify-content: flex-start;
        gap: 8px;
        padding-top: 8px;
    }

    .budget-actions button {
        flex: 1;
        max-width: 120px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media only screen and (min-width: 768px) and (max-width: 991px) {
    #charts-container {
        flex-direction: column;
        align-items: center;
    }
}

/* Large devices (laptops/desktops, 992px and up) */
@media only screen and (min-width: 992px) {
    #charts-container {
        flex-direction: row;
    }
}