/**
 * MuchData UI Enhancements
 * General layout improvements and visual polish
 * Version: 1.0
 */

/* ========================================
   SMOOTH ANIMATIONS
   ======================================== */

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* ========================================
   CARD ENHANCEMENTS
   ======================================== */

.card-enhanced {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.card-enhanced:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-enhanced:hover::before {
    transform: scaleX(1);
}

.card-enhanced .card-body {
    padding: 1.5rem;
}

/* Animated card entrance */
.card-animated {
    animation: fadeIn 0.5s ease forwards;
}

.card-animated:nth-child(1) { animation-delay: 0.1s; }
.card-animated:nth-child(2) { animation-delay: 0.2s; }
.card-animated:nth-child(3) { animation-delay: 0.3s; }
.card-animated:nth-child(4) { animation-delay: 0.4s; }

/* ========================================
   BUTTON ENHANCEMENTS
   ======================================== */

.btn-enhanced {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.btn-enhanced::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-enhanced:active::before {
    width: 300px;
    height: 300px;
}

.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.btn-gradient:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Loading button state */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

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

/* ========================================
   STAT CARDS WITH ICONS
   ======================================== */

.stat-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.stat-card-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    opacity: 0.1;
}

.stat-card-icon i {
    position: relative;
    z-index: 1;
}

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

.stat-card-icon.icon-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
}

.stat-card-icon.icon-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: white;
}

.stat-card-icon.icon-danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
}

/* ========================================
   TRANSACTION ITEMS
   ======================================== */

.transaction-item-enhanced {
    padding: 16px;
    border-radius: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.transaction-item-enhanced:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateX(4px);
}

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

.transaction-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.transaction-icon.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.transaction-icon.failed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ========================================
   LOADING STATES
   ======================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        #f3f4f6 0%,
        #e5e7eb 50%,
        #f3f4f6 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-card {
    height: 120px;
    border-radius: 12px;
}

/* ========================================
   BADGES & STATUS
   ======================================== */

.badge-enhanced {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.badge-success-soft {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge-warning-soft {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.badge-danger-soft {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.badge-info-soft {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* Pulsing badge for notifications */
.badge-pulse {
    animation: pulse 2s infinite;
}

/* ========================================
   QUICK ACTIONS GRID
   ======================================== */

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.quick-action-item {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.quick-action-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-action-item:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.quick-action-item:hover::before {
    opacity: 0.05;
}

.quick-action-item:active {
    transform: translateY(-2px);
}

.quick-action-icon-wrapper {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    border-radius: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    position: relative;
    z-index: 1;
}

.quick-action-label {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.quick-action-desc {
    font-size: 12px;
    color: #6b7280;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .quick-action-item {
        padding: 16px 12px;
    }
    
    .quick-action-icon-wrapper {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
}

/* ========================================
   WALLET BALANCE DISPLAY
   ======================================== */

.wallet-balance-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 32px;
    color: white;
    position: relative;
    overflow: hidden;
}

.wallet-balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.wallet-balance-amount {
    font-size: 48px;
    font-weight: 700;
    margin: 16px 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wallet-balance-label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .wallet-balance-card {
        padding: 24px;
    }
    
    .wallet-balance-amount {
        font-size: 36px;
    }
}

/* ========================================
   PROGRESS BARS
   ======================================== */

.progress-enhanced {
    height: 8px;
    border-radius: 10px;
    background: #e5e7eb;
    overflow: hidden;
}

.progress-bar-enhanced {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar-enhanced::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

/* ========================================
   NOTIFICATION DOTS
   ======================================== */

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    position: absolute;
    top: -2px;
    right: -2px;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

/* ========================================
   EMPTY STATES
   ======================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #9ca3af;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.empty-state-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}

/* ========================================
   FLOATING ACTION BUTTON
   ======================================== */

.fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 999;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .fab {
        bottom: 70px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* ========================================
   TOOLTIP ENHANCEMENTS
   ======================================== */

.tooltip-enhanced {
    position: relative;
    display: inline-block;
}

.tooltip-enhanced::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: #1f2937;
    color: white;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.tooltip-enhanced:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .show-mobile {
        display: none !important;
    }
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

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

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        break-inside: avoid;
    }
}
