body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; 
    margin: 0;
    background-color: #f4f4f4;
}

.container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 80%;
    max-width: 500px;
    display: flex;
    flex-direction: column; 
}

.header {
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 100; 
    padding: 10px 0;
    margin-bottom: 20px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px; 
}

.input-section {
    margin-bottom: 20px;
}

.income-input-section {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; 
}

button {
    background-color: #5cb85c;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

button:hover {
    background-color: #449d44;
}

.expense-list {
    margin-bottom: 20px;
}

.income-list {
    margin-bottom: 20px;
}

ul {
    list-style: none;
    padding: 0;
}

li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

li:last-child {
    border-bottom: none;
}

.total {
    text-align: right;
    font-size: 1.2em;
    color: #333;
}

.total-expenses {
    text-align: right;
    font-size: 1em;
    color: #333;
    margin-top: 10px;
}

.total-income {
    text-align: right;
    font-size: 1em;
    color: #333;
    margin-top: 10px;
}

.expense-type-links {
    margin-bottom: 10px;
    text-align: center;
}

.expense-type-links a {
    margin: 0 5px;
    text-decoration: none;
    color: #007bff;
}

.expense-type-links a:hover {
    text-decoration: underline;
}

.save-buttons {
    margin-top: 20px;
    text-align: center;
}

.save-buttons button {
    margin: 0 10px;
    width: auto; 
    display: inline-block; 
}

/* Basic Mobile Responsiveness */
@media (max-width: 600px) {
    .container {
        width: 95%;
    }
}

/* Style for Saved Files Section */
.saved-files {
    margin-top: 20px;
}

.saved-files h2 {
    text-align: center;
    color: #333;
    font-size: 1.2em;
    margin-bottom: 10px;
}

#savedFilesList {
    list-style: none;
    padding: 0;
}

#savedFilesList li {
    padding: 8px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

#savedFilesList li:last-child {
    border-bottom: none;
}

/* Add style for the delete file button */
.delete-button {
    background-color: #d9534f; /* Red color */
    color: white;
    border: none;
    padding: 2px 5px;
    margin-left: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7em;
    width: 50px;
}

.delete-button:hover {
    background-color: #c9302c; /* Darker red color */
}

/* Style for Edit file button */
.edit-file-button {
    background-color: #5cb85c; /* Green color */
    color: white;
    border: none;
    padding: 2px 5px;
    margin-left: 10px;
    border-radius: 4px;
    cursor: pointer;
    float: right;
    font-size: 0.7em;
    width: 50px;
    box-sizing: border-box;
}

.edit-file-button:hover {
    background-color: #449d44; /* Darker green color */
}

/* Style for sub-buttons container (initially hidden) */
.file-actions {
    display: none; /* Initially hidden */
    float: right;
    margin-left: 10px;
}

/* Style for the delete, rename and cancel sub-buttons */
.file-actions button {
    background-color: #d9534f; /* Red color */
    color: white;
    border: none;
    padding: 2px 5px;
    margin: 0 2px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7em;
    display: inline-block; /* Display buttons horizontally */
    width: 50px;
    box-sizing: border-box;
}

.file-actions button:hover {
    background-color: #c9302c; /* Darker red color */
}

/* Style for cancel button */
.file-actions button:last-child {
    background-color: #337ab7; /* Blue color for cancel */
}

.file-actions button:last-child:hover {
    background-color: #235a81; /* Darker blue color for cancel */
}

/* Show the sub-buttons when the container has the 'show' class */
.file-actions.show {
    display: block;
}