/* Transaction Modals Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    font-family: 'Inter', sans-serif;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #64748b;
    z-index: 10005; /* Extremely high z-index to stay on top */
    user-select: none;
    pointer-events: auto; /* Ensures click events are captured */
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #ef4444; /* Turns bright red on hover for good UX */
}

.modal-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1e293b;
    font-size: 22px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
}

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

.modal-form-group label {
    display: block;
    margin-bottom: 5px;
    color: #475569;
    font-weight: 500;
    font-size: 14px;
}

.modal-form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.modal-form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.modal-form-group input[readonly] {
    background-color: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.modal-submit-btn {
    width: 100%;
    padding: 14px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 10px;
}

.modal-submit-btn:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
}

.modal-submit-btn.btn-red {
    background-color: #ef4444;
}

.modal-submit-btn.btn-red:hover {
    background-color: #dc2626;
}

.modal-submit-btn.btn-purple {
    background-color: #a855f7;
}

.modal-submit-btn.btn-purple:hover {
    background-color: #9333ea;
}

.modal-alert {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.modal-alert.success {
    display: block;
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.modal-alert.error {
    display: block;
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
