/* ============================================
   TRANSACTION HISTORY MODAL STYLES
   Professional audit trail UI
   ============================================ */

.transaction-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    animation: fadeIn 0.2s ease;
}

.transaction-history-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.transaction-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.transaction-modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1f2e 0%, #0f1419 100%);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* Header */
.transaction-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transaction-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa 0%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.transaction-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.7);
}

.transaction-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: scale(1.05);
}

/* Stats Section */
.transaction-modal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    padding: 20px 28px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.transaction-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.stat-value.stat-positive {
    color: #34d399;
}

.stat-value.stat-negative {
    color: #f87171;
}

/* Body */
.transaction-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px;
}

.transaction-modal-body::-webkit-scrollbar {
    width: 8px;
}

.transaction-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.transaction-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.transaction-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Transaction List */
.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 16px;
    transition: all 0.2s ease;
}

.transaction-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.transaction-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.transaction-icon.positive {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.transaction-icon.negative {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.transaction-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transaction-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transaction-type {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.transaction-amount {
    font-size: 18px;
    font-weight: 700;
}

.transaction-amount.positive {
    color: #34d399;
}

.transaction-amount.negative {
    color: #f87171;
}

.transaction-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.transaction-reason {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    flex: 1;
}

.transaction-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.transaction-balance {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Courier New', monospace;
}

/* Loading State */
.transaction-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.transaction-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.transaction-loading p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
}

/* Empty State */
.transaction-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.transaction-empty svg {
    color: rgba(255, 255, 255, 0.3);
}

.transaction-empty p {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.transaction-empty span {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* Error State */
.transaction-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.transaction-error svg {
    color: #f87171;
}

.transaction-error p {
    color: #f87171;
    font-size: 16px;
}

/* Footer */
.transaction-modal-footer {
    padding: 20px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.transaction-modal-footer button {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .transaction-modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }

    .transaction-modal-header,
    .transaction-modal-body,
    .transaction-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .transaction-modal-stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px 20px;
        gap: 12px;
    }

    .transaction-item {
        padding: 12px;
        gap: 12px;
    }

    .transaction-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .transaction-type {
        font-size: 14px;
    }

    .transaction-amount {
        font-size: 16px;
    }

    .transaction-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .transaction-modal-footer {
        flex-direction: column-reverse;
    }

    .transaction-modal-footer button {
        width: 100%;
    }
}
