﻿body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1,h3 {
    text-align: center;
}

h2 {
    text-align: center; /* Centers the text horizontally */
    margin-top: 20px; /* Optional: Add spacing above the headings */
    margin-bottom: 20px; /* Optional: Add spacing below the headings */
}

form {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
}

input {
    width: 250px;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    color: #000;
}

input::placeholder {
    color: #ccc;
}

canvas {
    margin-top: 20px;
}

/* Default Light Mode Styles */
body {
    background-color: #ffffff;
    color: #000000;
}

.container {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #121212;
    color: #ffffff;
}

body.dark-mode .container {
    background-color: #1e1e1e;
    border-color: #333;
}

body.dark-mode input,
body.dark-mode button {
    background-color: #333;
    color: #ffffff;
    border: 1px solid #555;
}

body.dark-mode input::placeholder {
    color: #aaaaaa;
}

/* Dark Mode Toggle Container */
.dark-mode-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

/* Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 25px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 25px;
    transition: background-color 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.4s;
}

/* Sun and Moon Icons */
.icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
}

.sun {
    left: 8px;
    color: #f39c12;
}

.moon {
    right: 8px;
    color: #f1c40f;
    opacity: 0;
    transition: opacity 0.4s;
}

/* Dark Mode Active */
input:checked + .slider {
    background-color: #333;
}

input:checked + .slider:before {
    transform: translateX(25px);
}

input:checked + .slider .sun {
    opacity: 0;
}

input:checked + .slider .moon {
    opacity: 1;
}

/* Table Generation Button */
.generate-table-button {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.generate-table-button button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #0078d4;
    color: white;
    cursor: pointer;
    font-size: 16px;
}

.generate-table-button button:hover {
    background-color: #005bb5;
}

/* Floating Toolbar */
.floating-toolbar {
    position: fixed; /* Fix the toolbar to the viewport */
    top: 20px; /* Distance from the top of the viewport */
    right: 20px; /* Distance from the right of the viewport */
    z-index: 1000; /* Ensure it stays above other elements */
    background-color: #ffffff; /* Light background for visibility */
    border: 1px solid #ddd; /* Optional border for separation */
    border-radius: 8px; /* Rounded corners */
    padding: 10px; /* Add padding around the toggle and buttons */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    display: flex;
    flex-direction: column; /* Stack items vertically */
    align-items: center; /* Center items horizontally */
    gap: 15px; /* Add spacing between the toggle and buttons */
}

body.dark-mode .floating-toolbar {
    background-color: #1e1e1e; /* Dark background in dark mode */
    border-color: #333; /* Adjust border color for dark mode */
}

/* Toolbar Buttons */
.toolbar-buttons {
    display: flex;
    gap: 10px; /* Add spacing between the buttons */
}

.toolbar-buttons button {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.toolbar-buttons .save {
    background-color: #0078d4;
    color: white;
}

.toolbar-buttons .load {
    background-color: #28a745;
    color: white;
}

.toolbar-buttons .reset {
    background-color: #dc3545;
    color: white;
}

.toolbar-buttons button:hover {
    opacity: 0.9; /* Slight hover effect */
}

/* Graph Generation Button */
.generate-graphs-button {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.generate-graphs-button button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #0078d4;
    color: white;
    cursor: pointer;
    font-size: 16px;
}

.generate-graphs-button button:hover {
    background-color: #005bb5;
}

/* Footer Style */
footer {
    text-align: center; /* Center the text horizontally */
    padding: 10px; /* Add padding for spacing */
    background-color: #f9f9f9; /* Light background for distinction in light mode */
    color: #000; /* Text color for light mode */
}

body.dark-mode footer {
    background-color: #1e1e1e; /* Dark background for dark mode */
    color: #ffffff; /* Text color for dark mode */
}

select {
    width: 250px;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    color: #000;
}

select:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 5px rgba(0, 120, 212, 0.5);
}

.centered-link {
    display: block;
    text-align: center; /* Centers the link horizontally */
    margin-top: 10px; /* Adds spacing between the title and the link */
    font-size: 14px;
    color: #0078d4;
    text-decoration: none;
}

    .centered-link:hover {
        text-decoration: underline; /* Adds an underline on hover */
    }

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000; /* Ensure it appears above other elements */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scrolling if needed */
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
}

.modal-content {
    background-color: #fff;
    margin: 10% auto; /* Center the modal */
    padding: 20px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 50%; /* Adjust width as needed */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

    .close-button:hover,
    .close-button:focus {
        color: #000;
        text-decoration: none;
    }
/* Expense Table Styles */
.expense-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

    .expense-table th,
    .expense-table td {
        border: 1px solid #ddd;
        padding: 8px;
        text-align: left;
    }

    .expense-table th {
        background-color: #f4f4f4;
        font-weight: bold;
    }

    .expense-table tr:nth-child(even) {
        background-color: #f9f9f9;
    }

    .expense-table tr:hover {
        background-color: #f1f1f1;
    }

    .expense-table td[contenteditable="true"] {
        background-color: #fffbe6; /* Highlight editable cells */
        cursor: text;
    }
/* Dark Mode Styles for Modal */
body.dark-mode .modal-content {
    background-color: #1e1e1e; /* Dark background for modal */
    color: #ffffff; /* Light text color */
    border-color: #333; /* Adjust border color */
}

body.dark-mode .close-button {
    color: #ffffff; /* Light close button color */
}

    body.dark-mode .close-button:hover,
    body.dark-mode .close-button:focus {
        color: #aaaaaa; /* Slightly muted hover color */
    }

/* Dark Mode Styles for Inputs and Buttons in Modal */
body.dark-mode .modal-content input,
body.dark-mode .modal-content button {
    background-color: #333; /* Dark background for inputs and buttons */
    color: #ffffff; /* Light text color */
    border: 1px solid #555; /* Subtle border */
}

    body.dark-mode .modal-content input::placeholder {
        color: #aaaaaa; /* Muted placeholder color */
    }

body.dark-mode .modal-content button {
    background-color: #0078d4; /* Button background color */
    border: none;
    cursor: pointer;
}

    body.dark-mode .modal-content button:hover {
        background-color: #005bb5; /* Darker hover color */
    }

/* Dark Mode Styles for Expense Table */
body.dark-mode .expense-table th {
    background-color: #333; /* Dark header background */
    color: #ffffff; /* Light header text */
}

body.dark-mode .expense-table td {
    background-color: #1e1e1e; /* Dark cell background */
    color: #ffffff; /* Light cell text */
    border-color: #555; /* Subtle border color */
}

body.dark-mode .expense-table tr:nth-child(even) {
    background-color: #2a2a2a; /* Slightly lighter background for even rows */
}

body.dark-mode .expense-table tr:hover {
    background-color: #444; /* Highlight row on hover */
}

body.dark-mode .expense-table td[contenteditable="true"] {
    background-color: #333; /* Editable cell background */
    color: #ffffff; /* Editable cell text */
}
/* Dark Mode Styles for Start and End Age Inputs */
body.dark-mode .modal-content input {
    background-color: #333; /* Dark background for inputs */
    color: #ffffff; /* Light text color */
    border: 1px solid #555; /* Subtle border */
}

    body.dark-mode .modal-content input::placeholder {
        color: #aaaaaa; /* Muted placeholder color */
    }

/* Style for checkboxes in the expense form */
#expenseForm input[type="checkbox"] {
    margin-right: 5px;
    cursor: pointer;
}

#expenseForm label {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
}

/* Settings Icon */
.settings-icon {
    position: absolute;
    top: 10px;
    left: 10px;
}

    .settings-icon button {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: var(--text-color);
    }

/* Light Mode Styles */
body {
    background-color: #ffffff; /* Light mode background */
    color: #000000; /* Light mode text */
}

.modal-content {
    background-color: #ffffff; /* Light mode modal background */
    color: #000000; /* Light mode modal text */
    border: 1px solid #cccccc; /* Light mode modal border */
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #121212; /* Dark mode background */
    color: #ffffff; /* Dark mode text */
}

    body.dark-mode .modal-content {
        background-color: #121212; /* Dark mode modal background */
        color: #ffffff; /* Dark mode modal text */
        border: 1px solid #444444; /* Dark mode modal border */
    }

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    margin: 15% auto;
    padding: 20px;
    width: 50%;
}

.close-button {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* Settings Icon */
.settings-icon {
    position: absolute;
    top: 10px;
    left: 10px;
}

    .settings-icon button {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: inherit; /* Matches the current text color */
    }

/* Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

    .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: 0.4s;
    border-radius: 20px;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 14px;
        width: 14px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.4s;
        border-radius: 50%;
    }

input:checked + .slider {
    background-color: #4caf50;
}

    input:checked + .slider:before {
        transform: translateX(20px);
    }

/* Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

    .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: 0.4s;
    border-radius: 20px;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 14px;
        width: 14px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.4s;
        border-radius: 50%;
    }

/* Ensure Record Expenses and Record Contributions buttons are centered like Analyze button */
.generate-graphs-button {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

body.dark-mode .modal-content .delete-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    background-color: transparent; /* Ensure no background color is applied */
}

body.dark-mode .modal-content .delete-button:hover svg {
    fill: darkred; /* Darker red on hover */
}

body.dark-mode .modal-content button:hover {
    background-color: transparent;
}

body.dark-mode .modal-content .edit-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    background-color: transparent; /* Ensure no background color is applied */
}

body.dark-mode .modal-content .edit-button:hover svg {
    fill: darkgreen; /* Darker green on hover */
}
