/* ============================================
   PREMIUM ANIMATIONS & VISUAL ENHANCEMENTS
   Arbitrage Flow - Enhanced UI
   ============================================ */

/* ===== KEYFRAME ANIMATIONS ===== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 255, 136, 0.2),
                    0 0 10px rgba(0, 255, 136, 0.1);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.4),
                    0 0 30px rgba(0, 255, 136, 0.2),
                    0 0 40px rgba(0, 255, 136, 0.1);
    }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== ENHANCED COMPONENTS ===== */

/* Enhanced Sidebar */
.sidebar {
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(180deg, 
        rgba(15, 23, 42, 0.95) 0%, 
        rgba(15, 23, 42, 0.98) 100%) !important;
    backdrop-filter: blur(20px);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2),
                inset -1px 0 0 rgba(0, 255, 136, 0.1) !important;
}

/* Enhanced Navigation */
.nav-item {
    position: relative;
    overflow: hidden;
    gap: 15px !important;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, 
        rgba(0, 255, 136, 0.15) 0%, 
        transparent 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover::before {
    width: 100%;
}

.nav-item:hover {
    transform: translateX(5px);
}

.nav-item.active {
    background: linear-gradient(90deg, 
        rgba(0, 255, 136, 0.15) 0%, 
        rgba(0, 255, 136, 0.05) 100%) !important;
    box-shadow: inset 0 0 20px rgba(0, 255, 136, 0.1);
}

.nav-item .icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0.3));
}

.nav-item:hover .icon,
.nav-item.active .icon {
    transform: scale(1.2) rotate(5deg);
}

/* Enhanced Buttons */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #00d9ff 100%) !important;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3) !important;
}

.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.4) !important;
    animation: glow 2s ease-in-out infinite;
}

.btn-secondary:hover {
    transform: translateY(-2px) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.2) !important;
}

/* Enhanced Cards */
.card, .calculator-card, .opportunity-card, .settings-card, 
.sportsbook-balance-card, .chart-card {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, 
        rgba(30, 41, 59, 0.8) 0%, 
        rgba(15, 23, 42, 0.9) 100%) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 136, 0.1) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.card::before, 
.calculator-card::before, 
.opportunity-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 255, 136, 0.1),
        transparent
    );
    transition: left 0.5s;
}

.card:hover::before,
.calculator-card:hover::before,
.opportunity-card:hover::before {
    left: 100%;
}

.card:hover, 
.calculator-card:hover, 
.opportunity-card:hover,
.sportsbook-balance-card:hover,
.chart-card:hover {
    transform: translateY(-4px) !important;
    border-color: rgba(0, 255, 136, 0.3) !important;
    box-shadow: 0 12px 40px rgba(0, 255, 136, 0.2),
                0 0 0 1px rgba(0, 255, 136, 0.1) !important;
}

/* Enhanced Input Fields */
input, select, textarea {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 2px solid rgba(136, 146, 176, 0.2) !important;
    border-radius: 12px !important;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.1),
                0 4px 12px rgba(0, 255, 136, 0.2) !important;
    transform: translateY(-2px);
}

/* Enhanced ROI Badge */
.opportunity-roi {
    background: linear-gradient(135deg, var(--primary) 0%, #00d9ff 100%) !important;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.4) !important;
    animation: pulse 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.opportunity-roi::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 3s infinite;
}

/* Enhanced Header Stats */
.stat-mini {
    animation: slideDown 0.6s ease-out;
    background: linear-gradient(135deg, 
        rgba(0, 255, 136, 0.1) 0%, 
        rgba(0, 217, 255, 0.05) 100%) !important;
    border: 1px solid rgba(0, 255, 136, 0.2) !important;
    border-radius: 12px !important;
    padding: 12px 20px !important;
    transition: all 0.3s ease !important;
}

.stat-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3) !important;
    border-color: var(--primary) !important;
}

.stat-value.profit {
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5) !important;
}

/* Page Transitions */
.page {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.page.active {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced Modals */
.modal {
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 255, 136, 0.2) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(0, 255, 136, 0.1) !important;
}

/* Loading States */
.spinner, .loading-spinner {
    animation: rotate 1s linear infinite;
}

/* Notification Animations */
.notification {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced Table Rows */
.bet-row, .transaction-row {
    transition: all 0.3s ease;
}

.bet-row:hover, .transaction-row:hover {
    background: rgba(0, 255, 136, 0.05) !important;
    transform: translateX(5px);
    border-left: 3px solid var(--primary);
}

/* Enhanced Summary Cards */
.summary-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.summary-card:nth-child(1) { animation-delay: 0.1s; }
.summary-card:nth-child(2) { animation-delay: 0.2s; }
.summary-card:nth-child(3) { animation-delay: 0.3s; }
.summary-card:nth-child(4) { animation-delay: 0.4s; }

.summary-card:hover {
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 0 12px 40px rgba(0, 255, 136, 0.25) !important;
}

/* Enhanced Connection Status */
#connection-status {
    transition: all 0.3s ease;
}

#connection-status.connected {
    animation: pulse 2s ease-in-out infinite;
}

/* Smooth Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary) 0%, #00d9ff 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

/* Enhanced Bankroll Cards */
.sportsbook-balance-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sportsbook-balance-card:hover .sportsbook-logo {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.4);
}

/* Enhanced Filter Bar */
.filter-bar {
    animation: slideDown 0.5s ease-out;
}

.filter-select:focus, .filter-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1) !important;
}

/* Staggered Animations for Lists */
.opportunity-card:nth-child(1) { animation-delay: 0.05s; }
.opportunity-card:nth-child(2) { animation-delay: 0.1s; }
.opportunity-card:nth-child(3) { animation-delay: 0.15s; }
.opportunity-card:nth-child(4) { animation-delay: 0.2s; }
.opportunity-card:nth-child(5) { animation-delay: 0.25s; }

/* Enhanced Toggle Switch */
.toggle-slider {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary) 0%, #00d9ff 100%) !important;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5),
                inset 0 0 10px rgba(0, 255, 136, 0.2) !important;
}

/* Enhanced Chart Containers */
canvas {
    animation: fadeIn 0.8s ease-out;
}

/* Responsive Animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Glass morphism effect for modals */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    filter: blur(10px);
    z-index: -1;
}

