body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
}

.container {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    min-height: 100vh;
}

.chart {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.chart-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    align-items: stretch;
    min-height: fit-content;
}

.chart-row .chart {
    width: calc(50% - 10px);
    margin-bottom: 0;
    overflow: visible;
    flex: 1;
}

#expensesVsIncome, #monthlyExpenses {
    height: 400px;
}

#totalExpenses, #totalIncome {
    width: 100%;
    height: auto;
    min-height: 400px;
}

#monthlyExpenses, #monthlyIncome {
    height: 100vh; /* Set initial height to 100% of viewport height */
    min-height: 400px; /* Set a minimum height to prevent it from becoming too small */
}

header {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h1 {
    margin: 0;
}

.github-link {
    text-decoration: none;
    color: #0366d6;
    font-weight: bold;
}

.github-link:hover {
    text-decoration: underline;
}

/* Add these new styles */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.inheader-selector {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 14px;
    background-color: white;
}

.inheader-selector:hover {
    border-color: #666;
}

/* Add these styles at the end of the file */

.transactions-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

.transactions-table th,
.transactions-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.transactions-table th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 2;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

.transactions-table tr:hover {
    background-color: #f5f5f5;
}

.transactions-table tr.highlighted-row {
    background-color: #236aad !important;
}

.amount {
    font-family: monospace;
    text-align: right;
}

.tag {
    display: inline-block;
    background-color: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    margin: 2px;
    font-size: 0.9em;
}

.back-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #0366d6;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.back-button:hover {
    background-color: #0256b9;
}

.tooltip {
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    display: none;
    z-index: 1000;
    pointer-events: none;
}

.explanation-text {
    margin-top: 20px;
    font-size: 16px;
    line-height: 1.5;
    flex: 0 0 auto;
}

.preserve-line-breaks {
    white-space: pre-line;
}

.transactions-table tr.non-statistical {
    color: #888;
    background-color: #f5f5f5;
}

.clickable-note {
    text-align: center;
    color: #666;
    padding: 16px;
    background-color: #f8f8f8;
    border-radius: 6px;
    font-weight: normal;
}

.clickable-note:hover {
    background-color: #f0f0f0;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    position: relative;
    margin: auto;
    z-index: 10000;
}

.modal select,
.modal input {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.modal select:focus,
.modal input:focus {
    outline: none;
    border-color: #0366d6;
}

.modal .close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.modal .close:hover {
    color: #333;
}

.modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-right: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.primary-button, .secondary-button, .action-button {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 14px;
}

.primary-button {
    background-color: #0366d6;
    color: white;
}

.primary-button:hover {
    background-color: #0256b9;
}

.secondary-button {
    background-color: #e9ecef;
    color: #333;
    border-color: #ddd;
}

.secondary-button:hover {
    background-color: #ddd;
}

.action-button {
    background-color: #28a745;
    color: white;
}

.action-button:hover {
    background-color: #218838;
}

.toggle-button {
    padding: 2px 12px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #ddd;
    font-size: 14px;
    background-color: #6c757d;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
    box-sizing: border-box;
}

.toggle-button:hover {
    background-color: #5a6268;
}

.toggle-button.active {
    background-color: #dc3545;
}

.toggle-button.active:hover {
    background-color: #c82333;
}

.toggle-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
}

.toggle-text {
    white-space: normal;
    line-height: 1.2;
    text-align: left;
    max-width: 140px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.help-text {
    display: block;
    color: #666;
    font-size: 0.9em;
    margin-top: 4px;
}

.groups-table td.monospace {
    font-family: monospace;
    white-space: pre;
    vertical-align: top;
}

.groups-table td.monospace div {
    margin: 2px 0;
}

.table-container {
    margin-top: 20px;
    width: 100%;
    height: calc(100vh - 80px);
    overflow: auto;
    background: white;
}

/* Add alternating row colors */
.transactions-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Update hover state to be more visible */
.transactions-table tbody tr:hover {
    background-color: #b5c5d5;
}

/* Update non-statistical rows to preserve alternating pattern */
.transactions-table tr.non-statistical {
    color: #888;
}

.rule-item {
    padding: 4px 8px;
    margin: 2px 0;
    background: #f5f5f5;
    border-radius: 4px;
    font-family: monospace;
    word-break: break-all;
}

.transactions-table thead {
    /* Remove all styles */
}

.source-link,
.rule-link {
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
}

.rule-link:hover {
    color: #004499;
}

.rule-cell {
    padding: 12px;
}

.rule-cell:hover {
    background-color: #f0f7ff;
}
