/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Balance Animation */
.balance-update {
    animation: pulse 1s ease-in-out;
}

/* Transaction Items */
.transaction-item {
    transition: all 0.2s ease;
}

@media (hover: hover) {
    .transaction-item:hover {
        transform: translateX(4px);
    }
}

/* Loading Animation */
.loading-spinner {
    border: 2px solid rgba(44, 85, 48, 0.1);
    border-radius: 50%;
    border-top: 2px solid #2C5530;
    animation: spin 1s linear infinite;
}

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

/* Modal Animations */
.modal-backdrop {
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    animation: slideIn 0.3s ease-out;
}

/* Image Preview Styles */
#image-preview img {
    max-height: 200px;
    width: auto;
    margin: 0 auto;
    border-radius: 0.5rem;
}

/* Custom Form Styles */
input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .transaction-item {
        padding: 1rem;
    }
    
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

/* File Upload Styles */
#upload-container {
    min-height: 200px;
}

#id_proof_of_payment {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

#preview-container {
    min-height: 200px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

#preview-image {
    max-height: 300px;
    margin: auto;
}

/* Drag and drop states */
.drag-active {
    border-color: #2C5530;
    background-color: #F3F9F3;
}

/* Processing Animation Styles */
.dots-animation::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.progress-bar {
    background: #f3f4f6;
    border-radius: 9999px;
    overflow: hidden;
    height: 8px;
}

.progress-fill {
    background: #2C5530;
    height: 100%;
    width: 0;
    border-radius: 9999px;
    transition: width 0.5s ease-in-out;
}

button.processing {
    background-color: #234226 !important;
    cursor: not-allowed;
}

.processing-animation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Sweet Alert Customizations */
.swal2-popup {
    padding: 1.5rem !important;
    border-radius: 1rem !important;
    width: 24rem !important;
}

.swal2-title {
    font-size: 1.5rem !important;
    color: #1f2937 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.swal2-html-container {
    margin-top: 1rem !important;
    padding: 0 !important;
}

.swal2-icon {
    margin: 0 auto 1rem auto !important;
    border: none !important;
}

.swal2-actions {
    margin-top: 1.25rem !important;
}

.swal2-confirm {
    padding: 0.75rem 1.5rem !important;
    font-weight: 500 !important;
}

/* Remove default SweetAlert margins/padding */
.swal2-container {
    padding: 0 !important;
}

.swal2-popup.swal2-toast {
    padding: 0.75rem !important;
    width: auto !important;
}

/* Remove icon margin bottom when no title */
.swal2-icon.swal2-success,
.swal2-icon.swal2-error,
.swal2-icon.swal2-warning,
.swal2-icon.swal2-info,
.swal2-icon.swal2-question {
    margin-bottom: 0 !important;
}

/* Adjust spacing when both icon and title are present */
.swal2-icon + .swal2-title {
    margin-top: 1rem !important;
}

/* Add this to your existing CSS */
@keyframes smooth-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.smooth-spinner {
    animation: smooth-spin 1.5s linear infinite;
}