/* Custom scrollbar for dark theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #2d3748; /* Darker track */
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #4a5568; /* Slightly lighter thumb */
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6b7280; /* Lighter thumb on hover */
}
body {
    font-family: 'Inter', sans-serif;
    background-color: #1a202c; /* Dark background */
    color: #e2e8f0; /* Light text color */
}
.card {
    background-color: #2d3748; /* Dark card background */
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* shadow-md */
    padding: 1.5rem; /* p-6 */
}
.icon-wrapper {
    background-color: #4a5568; /* Icon background */
    border-radius: 9999px; /* rounded-full */
    padding: 0.5rem; /* p-2 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.transaction-type-income {
    background-color: #38a169; /* Green for income */
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem; /* rounded-md */
    font-size: 0.75rem; /* text-xs */
}
.transaction-type-expense {
    background-color: #e53e3e; /* Red for expense */
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem; /* rounded-md */
    font-size: 0.75rem; /* text-xs */
}
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.7); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: #2d3748;
    margin: auto;
    padding: 2rem;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    position: relative;
}
.close-button {
    color: #aaa;
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}
.close-button:hover,
.close-button:focus {
    color: white;
    text-decoration: none;
    cursor: pointer;
}

/* Custom Alert Modal */
#customAlertModal {
    display: none;
    position: fixed;
    z-index: 1001; /* Higher than other modals */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}
#customAlertModal .modal-content {
    background-color: #2d3748;
    padding: 1.5rem;
    border-radius: 0.75rem;
    max-width: 400px;
    text-align: center;
}
#customAlertModal button {
    background-color: #fcd34d;
    color: #1a202c;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: bold;
    margin-top: 1rem;
    cursor: pointer;
}

/* Loading Overlay */
#loadingOverlay {
    display: none;
    position: fixed;
    z-index: 1002; /* Highest */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
    font-size: 1.2rem;
}
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fcd34d;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .grid-cols-1, .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-5 {
        grid-template-columns: 1fr;
    }
    header {
        flex-direction: column;
        gap: 1rem;
    }
    #transaction-search {
        width: 100%;
    }
}

/* Category list styling */
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: #3c4758;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}
.category-actions button {
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}
.category-edit {
    background-color: #3b82f6;
}
.category-delete {
    background-color: #ef4444;
}

/* Notification toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #38a169;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1003;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Button animations */
button {
    transition: all 0.3s ease;
}
button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Card hover effect */
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* Input focus animation */
input:focus {
    outline: none;
    border-color: #fcd34d;
    box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.3);
    transition: all 0.2s ease;
}

/* Pulse animation for important elements */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Fade-in animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Gradient backgrounds */
.gradient-bg {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

/* Modern border radius */
.rounded-xl {
    border-radius: 1rem;
}