/* Reset default styles for consistency */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    padding: 20px;
    background-color: #e0f7fa;
    color: #333333;
    transition: background-color 0.3s, color 0.3s;
}

/* Dark mode styles */
body[data-theme="dark"] {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body[data-theme="dark"] .title-section,
body[data-theme="dark"] .input-section,
body[data-theme="dark"] .chart-section,
body[data-theme="dark"] .transaction-section,
body[data-theme="dark"] .categorized-transaction-section,
body[data-theme="dark"] #budgetSection,
body[data-theme="dark"] .help-section,
body[data-theme="dark"] .privacy-section,
body[data-theme="dark"] footer {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

body[data-theme="dark"] .input-section input,
body[data-theme="dark"] .input-section select,
body[data-theme="dark"] .chart-section select {
    background-color: #3a3a3a;
    color: #e0e0e0;
    border-color: #555555;
}

body[data-theme="dark"] #transactionList li,
body[data-theme="dark"] #categorizedTransactionList li,
body[data-theme="dark"] #budgetSection td,
body[data-theme="dark"] .chart-section canvas {
    background-color: #3a3a3a;
    color: #e0e0e0;
    border-color: #555555;
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2 {
    color: #ffffff;
}

body[data-theme="dark"] a {
    color: #ff6666;
}

body[data-theme="dark"] .consent-content {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

body[data-theme="dark"] .consent-content h2 {
    color: #ffffff;
}

body[data-theme="dark"] .consent-content p {
    color: #e0e0e0;
}

body[data-theme="dark"] .consent-content a {
    color: #ff6666;
}

body[data-theme="dark"] .transaction-section .total-income,
body[data-theme="dark"] .chart-section .month-income {
    color: #2ecc71;
    background-color: #1a3a1a;
}

body[data-theme="dark"] .transaction-section .total-expenses,
body[data-theme="dark"] .chart-section .month-expenses {
    color: #e74c3c;
    background-color: #3a1a1a;
}

.title-section {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
}

.logo {
    height: 80px;
    width: 80px;
    border: 2px solid #FFD700;
    border-radius: 50%;
}

h1, h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #1a1a1a;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.input-section {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
    justify-content: center;
    background-color: #ffffff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.input-section input, .input-section select {
    padding: 10px;
    font-size: 14px;
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #cccccc;
    border-radius: 5px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s;
}

.input-section input:focus, .input-section select:focus {
    border-color: #ff4444;
    outline: none;
}

.input-section button {
    padding: 10px 15px;
    font-size: 14px;
    background-color: #ff4444;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s, transform 0.2s;
}

.input-section button:hover {
    background-color: #cc0000;
    transform: translateY(-2px);
}

.input-section button#darkModeToggle {
    background-color: #4a90e2; /* Different color to distinguish it */
}

.input-section button#darkModeToggle:hover {
    background-color: #357abd;
    transform: translateY(-2px);
}

.file-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.csv-note {
    font-size: 12px;
    color: #666666;
    margin-top: 5px;
}

.chart-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin-bottom: 25px;
    max-width: 100%;
    align-items: center;
    background-color: #ffffff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.chart-section .chart-controls {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    text-align: center;
}

.chart-section select {
    padding: 10px;
    font-size: 14px;
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #cccccc;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100%;
    margin-bottom: 10px;
}

.chart-section .month-totals {
    width: 100%;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chart-section .month-income, .chart-section .month-expenses {
    padding: 8px;
    border-radius: 5px;
    margin: 0;
}

.chart-section .month-income {
    color: #2ecc71; /* Green for income */
    background-color: #e8f5e9; /* Light green background */
}

.chart-section .month-expenses {
    color: #e74c3c; /* Red for expenses */
    background-color: #ffebee; /* Light red background */
}

.chart-section canvas {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    width: 100% !important;
    height: 400px !important;
    max-height: 400px !important;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.transaction-section {
    text-align: center;
    margin-bottom: 25px;
    font-size: 18px;
    color: #1a1a1a;
    font-weight: bold;
    background-color: #ffffff;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.transaction-section .total-income, .transaction-section .total-expenses {
    font-size: 1.5em; /* Larger font size */
    font-weight: bold; /* Bold text */
    text-align: center; /* Center the text */
    margin: 10px 0; /* Add vertical spacing */
    padding: 10px; /* Add padding for better appearance */
    border-radius: 5px; /* Rounded corners */
    display: block; /* Ensure it takes full width for centering */
}

.transaction-section .total-income {
    color: #2ecc71; /* Green for income */
    background-color: #e8f5e9; /* Light green background */
}

.transaction-section .total-expenses {
    color: #e74c3c; /* Red for expenses */
    background-color: #ffebee; /* Light red background */
}

#transactionList, #categorizedTransactionList {
    list-style-type: none;
    margin: 0 auto;
    max-width: 800px;
    display: block; /* Ensure the list is visible */
}

#transactionList li, #categorizedTransactionList li {
    padding: 12px;
    background-color: #ffffff;
    color: #333333;
    margin-bottom: 8px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s;
}

#transactionList li:hover, #categorizedTransactionList li:hover {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

#transactionList li .button-group, #categorizedTransactionList li .button-group {
    display: flex;
    gap: 5px;
}

#transactionList li button, #categorizedTransactionList li button {
    padding: 6px 12px;
    background-color: #ff4444;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#transactionList li button:hover, #categorizedTransactionList li button:hover {
    background-color: #cc0000;
}

.categorized-transaction-section {
    text-align: center;
    margin-top: 25px;
    padding: 15px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: #1a1a1a;
}

.categorized-transaction-section h2 {
    margin-bottom: 15px;
    color: #1a1a1a;
    font-weight: bold;
}

.categorized-transaction-section ul {
    list-style-type: none;
    margin: 0 auto;
    max-width: 800px;
    display: block; /* Ensure the list is visible */
}

.categorized-transaction-section li {
    padding: 12px;
    background-color: #ffffff;
    color: #333333;
    margin-bottom: 8px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s;
    text-align: left; /* Keep category headers left-aligned */
}

.categorized-transaction-section li:hover {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.categorized-transaction-section li strong {
    display: block;
    margin-bottom: 5px;
}

.categorized-transaction-section li ul {
    margin-left: 0;
    margin-top: 5px;
}

.categorized-transaction-section li ul li {
    display: flex;
    justify-content: flex-end; /* Right-align the transaction details */
    align-items: center;
    padding: 5px 0;
    text-align: right; /* Right-align text within the li */
}

.categorized-transaction-section .button-group {
    display: flex;
    gap: 5px;
}

.categorized-transaction-section .button-group button {
    padding: 6px 12px;
    background-color: #ff4444;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.categorized-transaction-section .button-group button:hover {
    background-color: #cc0000;
}

#budgetSection {
    text-align: center;
    margin-top: 25px;
    padding: 15px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: #1a1a1a;
}

#budgetSection table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#budgetSection th, #budgetSection td {
    padding: 10px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

#budgetSection th {
    background-color: #ff4444;
    color: #ffffff;
}

#budgetSection td {
    background-color: #f9f9f9;
}

.help-section, .privacy-section {
    text-align: left;
    margin-top: 25px;
    padding: 15px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: #1a1a1a;
}

.help-section ul, .privacy-section ul {
    margin: 10px 0;
    padding-left: 20px;
}

.help-section li, .privacy-section li {
    margin-bottom: 10px;
}

.help-section a, .privacy-section a {
    color: #ff4444;
    text-decoration: none;
}

.help-section a:hover, .privacy-section a:hover {
    text-decoration: underline;
}

.consent-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none; /* Hide by default */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Ensure the popup can be shown when triggered */
.consent-popup.active {
    display: flex;
}

/* Ensure the popup can be hidden */
.consent-popup[style*="display: none"] {
    display: none !important;
}

.consent-content {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.consent-content h2 {
    margin-bottom: 15px;
    color: #1a1a1a;
    font-weight: bold;
}

.consent-content p {
    margin-bottom: 20px;
    color: #333333;
    font-size: 14px;
}

.consent-content a {
    color: #ff4444;
    text-decoration: none;
}

.consent-content a:hover {
    text-decoration: underline;
}

.consent-content button {
    padding: 10px 20px;
    background-color: #ff4444;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.consent-content button:hover {
    background-color: #cc0000;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-top: 25px;
    color: #1a1a1a;
}

footer a {
    color: #ff4444;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}