* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

/* Login Styles */
.login-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-top: 50px;
}

/* Accounting container styles */
.accounting-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 20px;
    border-radius: 50%;
}

.form-container {
    margin-top: 20px;
}

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

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

.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.btn-clear-date {
    position: absolute;
    right: 30px; /* Moved to the left to not overlap with calendar icon */
    background: rgba(220, 220, 220, 0.5);
    border: none;
    border-radius: 50%;
    color: #333;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.2s ease;
    z-index: 2; /* Ensure it's above other elements */
}

.btn-clear-date:hover {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    margin-right: 8px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background-color: #3498db;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #e74c3c;
    color: white;
}

.btn-secondary:hover {
    background-color: #c0392b;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid #3498db;
    color: #3498db;
    padding: 10px 22px;
    margin-right: 10px;
}

.btn-outline:hover {
    background-color: #f1f9fe;
}

/* Evidence Upload Section */
.evidence-container {
    border: 2px dashed #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.evidence-buttons {
    display: flex;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.selected-files-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    min-height: 40px;
}

.selected-file {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    background-color: #f9f9f9;
}

.selected-file img {
    max-height: 40px;
    max-width: 40px;
    margin-right: 10px;
    border-radius: 2px;
}

.file-remove {
    margin-left: 10px;
    color: #e74c3c;
    cursor: pointer;
    font-weight: bold;
}

/* Autocomplete Container */
.autocomplete-container {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    position: absolute;
    width: 100%;
    z-index: 100;
    display: none;
    margin-top: 2px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.suggestions-list {
    width: 100%;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.suggestion-item:hover {
    background-color: #f1f9fe;
}

.suggestion-item:last-child {
    border-bottom: none;
}

#category-autocomplete-container {
    z-index: 101; /* Higher z-index to appear above description autocomplete */
}

/* Helper Text */
.helper-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-style: italic;
}

/* Progress Indicator */
.progress-container {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    margin: 20px 0;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: #4CAF50;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #333;
}

/* Listing Screen Styles */
.listing-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.filter-container {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.filter-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-row .form-group {
    flex: 1;
    min-width: 200px;
}

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

.filter-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.filter-actions button:active {
    transform: scale(0.98);
}

#filter-btn {
    background-color: #4CAF50;
    color: white;
}

#filter-btn:hover {
    background-color: #3e8e41;
}

#reset-filter-btn {
    background-color: #f0f0f0;
    color: #333;
}

#reset-filter-btn:hover {
    background-color: #e0e0e0;
}

/* Button loading state */
.btn-loading {
    opacity: 0.7;
    pointer-events: none;
    padding-right: 40px !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    right: 15px;
    margin-top: -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.entries-container {
    margin-top: 20px;
}

.entry-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.entry-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.entry-id {
    color: #666;
    font-size: 14px;
}

.entry-date {
    font-weight: bold;
}

.human-code {
    margin-left: 10px;
    font-size: 14px;
    font-family: monospace;
    background-color: #f0f7ff;
    padding: 2px 6px;
    border-radius: 3px;
    color: #0066cc;
    font-weight: 500;
    display: inline-block;
}

.entry-amount {
    font-size: 18px;
    font-weight: bold;
}

.entry-amount.credit {
    color: #2ecc71;
}

.entry-amount.debit {
    color: #e74c3c;
}

.entry-details {
    margin-bottom: 10px;
}

.entry-category {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    margin-right: 10px;
}

.entry-description {
    color: #444;
}

.entry-documents {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #f0f0f0;
}

.document-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    margin: 3px 0;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer; /* Add pointer cursor to indicate clickability */
}

.document-link:hover {
    background-color: #e8f4fd;
    color: #0066cc;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.document-link:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.document-link:active {
    transform: translateY(0);
    box-shadow: none;
}

.document-link::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: -100%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    transition: all 0.6s ease;
}

.document-link:hover::before {
    left: 100%;
}

.document-icon {
    margin-right: 5px;
    font-size: 16px;
}

.loading-message {
    text-align: center;
    padding: 20px;
    color: #666;
}

.no-entries-message {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    z-index: 1000;
    font-size: 16px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.error-message {
    color: #e74c3c;
    margin-top: 10px;
    text-align: center;
}

/* For file preview thumbnails */
.file-thumbnail {
    display: flex;
    align-items: center;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 8px;
}

.file-thumbnail .file-icon {
    width: 24px;
    margin-right: 8px;
    color: #7f8c8d;
}

.file-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}
