/* General styles */
body {
    font-family: Arial, sans-serif;
    background-color: #d4d4d4;
    color: #333;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s; /* Smooth transition for background and text color */
}

.container {
    display: flex;
    justify-content: space-between;
    max-width: 1600px;
    min-height: 800px;
    margin: 30px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.445);
    gap: 20px;
    transition: background 0.3s, border 0.3s, box-shadow 0.3s; /* Smooth transition for background, border, and shadow */
}

/* Adjust the width and margin for sections */
.left-section {
    flex: 1; /* Allow this section to grow and shrink */
    min-width: 300px; /* Ensure a minimum width */
    margin-right: 20px;
}

.center-section {
    width: 40%;
}

.left-section, .right-section {
    margin-right: 20px; /* Space between the left and center sections */
}

.center-section {
    margin-left: 50px; /* Space between the center and right sections */
    margin-right: 50px; /* Space between the center and left sections */
}

h1, h2, p {
    text-align: center;
}

.input-section, .expense-section, .budget-details, .expense-log {
    margin: 20px 0;
    padding: 2px 10px 10px 10px;
}

/* Basic styling for select element */
select {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    box-sizing: border-box;
    border: 1px solid #ccc; /* Optional: Adjust border color */
    border-radius: 4px; /* Optional: Adjust border radius */
    font-size: 15px; /* Optional: Adjust font size */
    background-color: #fff; /* Optional: Adjust background color */
}

/* Add styles for focus state if needed */
select:focus {
    border-color: #007bff; /* Adjust the border color on focus */
    outline: none; /* Remove default focus outline */
}

/* Optional: Adjust font size and padding for better alignment */
select option {
    font-size: 16px; /* Adjust font size of options */
    padding: 100px; /* Adjust padding of options */
    border-radius: 0;
}


.button-container {
    display: flex;
    justify-content: center;
}

input, button {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    box-sizing: border-box;
}

.budget-details {
    background-color: #BBD1EA;
    border: 5px;
    border-radius: 25px;
    border-inline-style: solid;
    border-inline-color: #7C99B6;
    font-weight: 500;
    padding: 20px; /* Increase padding if needed */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Optional: add shadow for better visibility */
    width: 100%; /* Take full width of the parent */
}

.center-section, .right-section {
    flex: 1;
    min-width: 300px; /* Ensure a minimum width */
}

label {
    display: block;
    margin: 10px 0 5px;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 200px;
}

button:hover {
    background-color: #0056b3;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px;
    background-color: #28a745; /* Green background for success */
    color: white;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: none; /* Hidden by default */
    font-size: 16px;
    z-index: 1000;
}

/* Error Notification styles */
.error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px;
    background-color: #dc3545; /* Red background for error */
    color: white;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: none; /* Hidden by default */
    font-size: 16px;
    z-index: 1000;
}

/* Animation for notifications */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.show-notification, .show-error-notification {
    display: block;
    animation: bounce 0.6s ease;
    z-index: 1;
}

.chart {
    padding-top: 30px;
}

.chart h3 {
    text-align: center;
}

/* Table styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.purpose {
    text-transform: capitalize;
}

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

thead {
    background-color: #f4f4f4;
}

input[type="datetime-local"] {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 5px; /* Add rounded corners */
    background-color: #ffffff; /* Background color */
    color: #333; /* Text color */
    font-size: 16px; /* Font size */
    box-sizing: border-box; /* Include padding and border in the element’s total width and height */
    transition: border-color 0.3s, box-shadow 0.3s; /* Smooth transition for border and shadow */
}

input[type="datetime-local"]:focus {
    border-color: #007bff; /* Change border color on focus */
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); /* Add a shadow effect on focus */
    outline: none; /* Remove the default outline */
}

.datetime-input {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #ffffff;
    color: #333;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.datetime-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    outline: none;
}

.datetime-label {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    line-height: 40px; /* Match the input height */
    padding: 10px;
    font-size: 16px;
    color: #888;
    pointer-events: none;
    transition: opacity 0.3s, color 0.3s;
}

.datetime-input:focus + .datetime-label,
.datetime-input:not(:placeholder-shown) + .datetime-label {
    opacity: 0;
    color: transparent; /* Hide label text */
}


/* Date-time display styles */
.date-time-display {
    position: fixed;
    bottom: 20px;
    left: 20px;
    padding: 10px;
    background-color: #A1C6EA; /* Background color */
    color: black;
    font-weight: 600;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: transform 0.3s ease; /* Smooth movement */
    pointer-events: none; /* Ignore pointer events */
}

.date-time-display i {
    font-size: 20px; /* Adjust clock icon size */
    margin-right: 5px; /* Space between icon and time text */
}

/* Button group styles */
.button-group {
    display: flex;
    gap: 10px; /* Space between the buttons */
    align-items: center; /* Center icons and text */
    display: flex;
    justify-content: center;
    
}

.button-group button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px; /* Space between icon and text */
    padding: 10px 20px; /* Adjust padding for better appearance */
}

/* Icon styles */
.button-group i {
    font-size: 16px; /* Adjust icon size */
}

/* Modal styles */

.modal-container {
    padding: 0; /* Adjust as needed */
    height: auto; /* Ensure it fits content */
}

#confirmImportButton {
    margin: 0; /* Ensure no extra margin */
    padding: 10px; /* Adjust as needed */
}


.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: center;
}


.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 500px;
    height: auto;
    justify-content: center;
    align-items: center;
}

.import-export-buttons {
    margin-left: 50px;
    display: flex;
    justify-content: center; /* Center buttons horizontally */
    gap: 10px;
}

.import-export-buttons button {
    margin-bottom: 10px;
}

.expense-log-grid {
    display: grid;
    place-items: top; /* Center both horizontally and vertically */
    height: 100%; /* Adjust based on your design */
}

.expense-log-container {
    overflow-x: auto;
    width: 100%;
    max-width: 1200px; /* Optional: Limit the maximum width */
}

.expense-log-table {
    width: 100%;
    border-collapse: collapse;
}

.expense-log-table th, .expense-log-table td {
    padding: 8px;
    border: 1px solid #ddd;
}

.expense-log-table th {
    background-color: #f4f4f4;
}

.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
    transition: background-color 0.3s, color 0.3s; /* Smooth transition for background and text color */
}

.dark-mode select {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    box-sizing: border-box;
    border: 1px solid #555; /* Optional: Adjust border color */
    border-radius: 4px; /* Optional: Adjust border radius */
    font-size: 15px; /* Optional: Adjust font size */
    background-color: #333; /* Optional: Adjust background color */
    color: #e0e0e0;
}

/* Add styles for focus state if needed */
.dark-mode select:focus {
    border-color: #007bff; /* Adjust the border color on focus */
    outline: none; /* Remove default focus outline */
}

/* Optional: Adjust font size and padding for better alignment */
.dark-mode select option {
    font-size: 16px; /* Adjust font size of options */
    padding: 100px; /* Adjust padding of options */
    border-radius: 0;
}

.dark-mode .container {
    background: #1e1e1e;
    border: 1px solid #333;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
    transition: background 0.3s, border 0.3s, box-shadow 0.3s; /* Smooth transition for container background, border, and shadow */
}

.dark-mode input, .dark-mode button {
    background-color: #333;
    color: #e0e0e0;
    border: 1px solid #555;
    transition: background-color 0.3s, color 0.3s, border 0.3s; /* Smooth transition for input and button */
}

.dark-mode button:hover {
    background-color: #444;
}

.dark-mode .error-notification {
    background-color: #463030;
    color: #e0e0e0;
    transition: background-color 0.3s, color 0.3s; /* Smooth transition for notifications */
}

.dark-mode .notification {
    background-color: #374630;
    color: #e0e0e0;
    transition: background-color 0.3s, color 0.3s; /* Smooth transition for notifications */
}

.dark-mode .modal-content {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #333;
    transition: background-color 0.3s, color 0.3s, border 0.3s; /* Smooth transition for modal */
}

.dark-mode .expense-log-table th {
    background-color: #2c2c2c;
    transition: background-color 0.3s; /* Smooth transition for table headers */
}

.dark-mode .expense-log-table td {
    background-color: #1e1e1e;
    color: #e0e0e0;
    transition: background-color 0.3s, color 0.3s; /* Smooth transition for table cells */
}

.dark-mode .date-time-display {
    background-color: #333;
    color: #e0e0e0;
    transition: background-color 0.3s, color 0.3s; /* Smooth transition for date-time display */
}

.dark-mode .budget-details {
    background-color: #1e1e1e;
    border-inline-color: #333;
    transition: background-color 0.3s, border-inline-color 0.3s; /* Smooth transition for budget details */
}

/* Sun and Moon icon transition */
.sun-icon, .moon-icon {
    transition: color 0.3s, background-color 0.3s, border 0.3s; /* Smooth transition for icon color and background */
}

.theme-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
}

.theme-toggle label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #333;
}

.theme-toggle input {
    margin-left: 10px;
}

/* Custom switch styles */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    left: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    border-radius: 50%;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #007bff; /* Background color when checked (blue) */
}

input:checked + .slider:before {
    transform: translateX(26px); /* Move the toggle switch to the right */
}

/* Add a rounded effect for the slider */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Icon container styles */
.icon-container {
    position: fixed;
    left: 10px;
    top: 3%;
    transform: translateY(20%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.sun-icon {
    font-size: 27px;
    color: #000000; /* Sun icon color */
    cursor: pointer;
    transition: color 0.3s, border 0.3s;
}

.moon-icon {
    font-size: 27px;
    color: #c5c5c5;
    cursor: pointer;
    transition: color 0.3s;
}

/* Dark mode icon visibility */
.dark-mode .sun-icon {
    display: none;
}

.dark-mode .moon-icon {
    display: inline;
}

.sun-icon, .moon-icon {
    position: relative;
}

/* Media query for mobile */
@media (max-width: 1500px) {

    .import-export-buttons {
        margin-left: 0px;
    }

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

    .left-section, .right-section, .center-section {
        width: 100%;
        margin-bottom: 20px;
    }

    .left-section, .right-section {
        margin-right: 0; /* Remove margin for smaller screens */
    }

    .center-section {
        margin-left: 0; /* Remove margin for smaller screens */
        margin-right: 0; /* Remove margin for smaller screens */
    }

    .input-section, .expense-section, .budget-details, .expense-log {
        padding: 5px;
    }

    input, button {
        padding: 8px;
        font-size: 17px;
        height: 60px;
    }

    table {
        font-size: 18px;
    }

    .notification, .error-notification {
        font-size: 12px;
        padding: 8px;
    }

    .budget-container {
        display: flex;
        justify-content: center; /* Center horizontally */
        align-items: center; /* Center vertically */
    }

    .budget-details {
        width: 80%;
    }

    .date-time-display {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 10px;
    }

    input, button {
        padding: 6px;
    }

    table {
        font-size: 12px;
    }
}