/* Ask AI Floating Feature */
.ask-ai-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 4px solid white;
}

.ask-ai-trigger:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.5);
}

.ask-ai-modal {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 400px;
    height: 600px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(20px);
}

.ask-ai-modal.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.ai-chat-header {
    padding: 20px;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chat-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
}

.ai-chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent 60%);
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.ai-chat-body::-webkit-scrollbar {
    width: 4px;
}

.ai-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-body::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

.ai-chat-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.ai-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
}

.ai-msg.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ai-msg.bot {
    background: white;
    color: var(--text-dark);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.ai-chat-footer {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    background: white;
}

.ai-chat-footer input {
    flex: 1;
    border: 1px solid #e2e8f0;
    padding: 10px 15px;
    border-radius: 12px;
    outline: none;
    font-size: 0.9rem;
}

.ai-predefined {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 15px 20px;
    background: transparent;
}

.pre-btn {
    background: white;
    border: 1px solid var(--primary-light);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}

.pre-btn:hover {
    background: var(--primary);
    color: white;
}

@media (max-width: 768px) {
    .ask-ai-modal {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        bottom: 155px;
        height: 480px;
    }

    .ask-ai-trigger {
        bottom: 120px;
        right: 20px;
        width: 55px;
        height: 55px;
    }

    .ai-chat-footer {
        padding: 10px !important;
    }
}

.ai-msg {
    padding: 12px 18px;
    border-radius: 18px;
    max-width: 85%;
    font-size: 0.92rem;
    line-height: 1.6;
    position: relative;
    animation: msgAppear 0.3s ease-out;
    box-shadow: var(--shadow-sm);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ai-msg b,
.ai-msg strong {
    font-weight: 700;
    color: var(--text-dark);
}

.ai-msg ul,
.ai-msg ol {
    margin: 8px 0 8px 20px;
    padding: 0;
}

.ai-msg li {
    margin-bottom: 4px;
}

#aiChatInput::-webkit-scrollbar {
    width: 4px;
}

#aiChatInput::-webkit-scrollbar-track {
    background: transparent;
}

#aiChatInput::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

#aiChatInput::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.tx-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: white;
}

.tx-list {
    max-height: 380px;
    /* Adjusted to show approx 4 transactions */
    overflow-y: auto;
    padding-right: 8px;
}

.tx-list::-webkit-scrollbar {
    width: 5px;
}

.tx-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

.tx-item {
    display: flex;
    align-items: center;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.tx-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.tx-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 16px;
    flex-shrink: 0;
}

.tx-info {
    flex: 1;
}

.tx-info h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.tx-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.tx-amount {
    text-align: right;
}

.tx-amount h4 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.tx-actions button {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    margin-left: 4px;
}

.tx-actions button:hover {
    color: var(--primary);
    background: white;
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}