/* =========================================
   ARTIWING - PREMIUM ENHANCEMENTS
   Ultra-Sophisticated Effects & Interactions
   ========================================= */

/* ===== GLOBAL PREMIUM EFFECTS ===== */
.laptop-device,
.mobile-device,
.info-card,
.activity-row,
.primary-metric-card {
    will-change: transform, opacity, box-shadow;
}

/* Enhanced Device Shadows with Depth */
.laptop-frame {
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.4),
        0 15px 40px rgba(0, 0, 0, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.2);
}

.laptop-device:hover .laptop-frame {
    box-shadow:
        0 40px 100px rgba(0, 0, 0, 0.45),
        0 20px 50px rgba(0, 0, 0, 0.35),
        0 8px 20px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.25);
}

/* Screen Ambient Glow */
.laptop-display::after {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    right: -20%;
    bottom: -20%;
    background: radial-gradient(
        ellipse at center,
        rgba(79, 143, 247, 0.15) 0%,
        rgba(59, 130, 246, 0.08) 30%,
        transparent 60%
    );
    pointer-events: none;
    z-index: -1;
    opacity: 0.6;
    animation: ambientPulse 6s ease-in-out infinite;
}

@keyframes ambientPulse {
    0% {
        opacity: 0.4;
        transform: scale(1) rotate(0deg);
    }
    33% {
        opacity: 0.55;
        transform: scale(1.03) rotate(2deg);
    }
    66% {
        opacity: 0.7;
        transform: scale(1.05) rotate(-1deg);
    }
    100% {
        opacity: 0.4;
        transform: scale(1) rotate(0deg);
    }
}

/* ===== PREMIUM CARD ENHANCEMENTS ===== */
/* Primary Metric Card - Advanced Glow Effect */
.primary-metric-card {
    box-shadow:
        0 8px 32px rgba(59, 130, 246, 0.35),
        0 4px 16px rgba(59, 130, 246, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 40px rgba(79, 143, 247, 0.25);
}

.primary-metric-card:hover {
    box-shadow:
        0 16px 56px rgba(59, 130, 246, 0.45),
        0 8px 28px rgba(59, 130, 246, 0.3),
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 70px rgba(79, 143, 247, 0.35);
    transform: translateY(-3px) scale(1.01);
}

/* Shimmer enhancement with color shift */
.primary-metric-card::before {
    background: linear-gradient(
        120deg,
        transparent 35%,
        rgba(255, 255, 255, 0.15) 48%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0.15) 52%,
        transparent 65%
    );
}

/* Chart Bar Advanced Effects */
.chart-bar {
    background: rgba(255, 255, 255, 0.35);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.chart-bar:hover {
    background: rgba(255, 255, 255, 0.5);
    box-shadow:
        0 5px 16px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 2px rgba(0, 0, 0, 0.05),
        0 0 16px rgba(255, 255, 255, 0.3);
    transform: scaleY(1.08) translateY(-2px);
}

/* Info Cards - Depth & Hover States */
.info-card {
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 1px 2px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.info-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.05), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.info-card:hover::before {
    opacity: 1;
}

.info-card:hover {
    transform: translateY(-6px) scale(1.02) rotateX(2deg);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.14),
        0 8px 20px rgba(0, 0, 0, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Activity Rows - Sliding Border Effect */
.activity-row {
    position: relative;
    overflow: hidden;
}

.activity-row::after {
    content: '';
    position: absolute;
    left: -100%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    transition: left 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
}

.activity-row:hover::after {
    left: 0;
}

.activity-row:hover {
    transform: translateX(8px) scale(1.02);
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.14),
        0 6px 16px rgba(0, 0, 0, 0.1),
        -6px 0 0 rgba(59, 130, 246, 0.45),
        0 0 24px rgba(59, 130, 246, 0.15);
}

/* Activity Icon Ripple Effect */
.activity-icon-wrapper {
    position: relative;
    overflow: visible;
}

.activity-icon-wrapper::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 10px;
    background: inherit;
    opacity: 0;
    transform: scale(0.8);
    animation: iconRipple 2.5s ease-out infinite;
}

@keyframes iconRipple {
    0% {
        opacity: 0.7;
        transform: scale(0.85);
    }
    40% {
        opacity: 0.5;
        transform: scale(1.15);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

.activity-row:nth-child(1) .activity-icon-wrapper::before {
    animation-delay: 0s;
}

.activity-row:nth-child(2) .activity-icon-wrapper::before {
    animation-delay: 0.8s;
}

.activity-row:nth-child(3) .activity-icon-wrapper::before {
    animation-delay: 1.6s;
}

/* ===== NAV SIDEBAR ENHANCEMENTS ===== */
.nav-item {
    position: relative;
}

/* Animated background on hover */
.nav-item::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255, 87, 87, 0.08), transparent);
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-item:hover::after,
.nav-item.active::after {
    opacity: 1;
}

.nav-item svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    transition: filter 0.2s ease;
}

.nav-item:hover svg,
.nav-item.active svg {
    filter: drop-shadow(0 2px 4px rgba(255, 87, 87, 0.3));
}

/* ===== TOPBAR ENHANCEMENTS ===== */
/* Logo icon pulsing glow */
.logo-icon-pro::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 87, 87, 0.4) 0%, transparent 70%);
    opacity: 0;
    animation: logoGlow 4s ease-in-out infinite;
}

@keyframes logoGlow {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    40% {
        opacity: 0.8;
        transform: scale(1.1);
    }
    60% {
        opacity: 1;
        transform: scale(1.25);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* Notification Badge Advanced Pulse */
.notification-badge {
    animation: badgeEnhancedPulse 3s ease-in-out infinite;
}

@keyframes badgeEnhancedPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    }
    25% {
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.6);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 3px 9px rgba(239, 68, 68, 0.5);
    }
    75% {
        transform: scale(1.12);
        box-shadow: 0 4px 14px rgba(239, 68, 68, 0.65);
    }
}

/* User Avatar Hover Effect */
.topbar-user:hover .user-avatar-pro {
    box-shadow:
        0 4px 16px rgba(59, 130, 246, 0.5),
        0 0 20px rgba(59, 130, 246, 0.3);
    transform: scale(1.05);
}

/* ===== TOAST NOTIFICATIONS ENHANCED ===== */
.toast-notification {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.toast-notification::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.toast-icon-wrapper {
    animation: toastIconBounce 5s ease-in-out 1s infinite;
}

@keyframes toastIconBounce {
    0%, 90%, 100% {
        transform: scale(1);
    }
    2% {
        transform: scale(1.15);
    }
    4% {
        transform: scale(0.95);
    }
    6% {
        transform: scale(1.05);
    }
    8% {
        transform: scale(1);
    }
}

/* ===== MOBILE DEVICE ENHANCEMENTS ===== */
.mobile-frame {
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.35),
        0 12px 32px rgba(0, 0, 0, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.2);
}

.mobile-device:hover .mobile-frame {
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.4),
        0 16px 40px rgba(0, 0, 0, 0.3),
        0 6px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.25);
}

/* Mobile Display Ambient Glow */
.mobile-display::after {
    content: '';
    position: absolute;
    top: -30%;
    left: -30%;
    right: -30%;
    bottom: -30%;
    background: radial-gradient(
        ellipse at center,
        rgba(79, 143, 247, 0.12) 0%,
        rgba(59, 130, 246, 0.06) 30%,
        transparent 50%
    );
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
    animation: mobileAmbient 7s ease-in-out infinite;
}

@keyframes mobileAmbient {
    0% {
        opacity: 0.3;
        transform: scale(1) rotate(0deg);
    }
    33% {
        opacity: 0.45;
        transform: scale(1.05) rotate(3deg);
    }
    66% {
        opacity: 0.6;
        transform: scale(1.1) rotate(6deg);
    }
    100% {
        opacity: 0.3;
        transform: scale(1) rotate(0deg);
    }
}

/* Mobile Cards Enhanced */
.mobile-card.primary-mobile-card {
    box-shadow:
        0 8px 32px rgba(59, 130, 246, 0.35),
        0 4px 16px rgba(59, 130, 246, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mobile-card.primary-mobile-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        120deg,
        transparent 35%,
        rgba(255, 255, 255, 0.1) 48%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.1) 52%,
        transparent 65%
    );
    animation: mobileShimmer 5s ease-in-out infinite;
}

@keyframes mobileShimmer {
    0%, 100% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    50% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Mobile Alert Banner Pulse */
.mobile-alert-banner {
    box-shadow:
        0 4px 16px rgba(245, 158, 11, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.08);
    animation: alertBannerPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 2.8s forwards,
               alertGlimmer 3s ease-in-out 3.6s infinite;
}

@keyframes alertGlimmer {
    0%, 100% {
        box-shadow:
            0 4px 16px rgba(245, 158, 11, 0.2),
            0 2px 8px rgba(0, 0, 0, 0.08);
    }
    50% {
        box-shadow:
            0 6px 24px rgba(245, 158, 11, 0.3),
            0 3px 12px rgba(0, 0, 0, 0.1);
    }
}

/* ===== TIME TABS INTERACTIVE STATES ===== */
.time-tab {
    position: relative;
    overflow: hidden;
}

.time-tab::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.5s cubic-bezier(0.4, 0, 0.2, 1), height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.time-tab:hover::before {
    width: 120%;
    height: 120%;
}

.time-tab.active::before {
    width: 100%;
    height: 100%;
}

/* ===== METRIC VALUE GLOWING TEXT ===== */
.metric-value-large {
    position: relative;
}

.metric-value-large::before {
    content: attr(data-target);
    position: absolute;
    inset: 0;
    text-shadow:
        0 0 20px rgba(255, 255, 255, 0.6),
        0 0 40px rgba(255, 255, 255, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    animation: textGlow 4s ease-in-out 2s infinite;
}

@keyframes textGlow {
    0%, 90%, 100% {
        opacity: 0;
    }
    45%, 55% {
        opacity: 0.3;
    }
}

/* ===== ROW VALUES COUNTER ANIMATION ===== */
.row-value.success {
    animation: successPulse 3s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% {
        color: #10B981;
    }
    50% {
        color: #34D399;
        text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    }
}

/* ===== HELP BUTTON RIPPLE ===== */
.help-button {
    overflow: hidden;
    position: relative;
}

.help-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.help-button:hover::before {
    width: 200%;
    height: 200%;
}

/* ===== DASHBOARD TITLE UNDERLINE EFFECT ===== */
.dashboard-title {
    position: relative;
    display: inline-block;
}

.dashboard-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #3B82F6, #60A5FA, transparent);
    border-radius: 2px;
    animation: titleUnderlineSlide 3s ease-in-out infinite;
}

@keyframes titleUnderlineSlide {
    0%, 100% {
        left: 0;
        width: 40px;
    }
    50% {
        left: calc(100% - 40px);
        width: 40px;
    }
}

/* ===== PERFORMANCE OPTIMIZATION ===== */
/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
    }

    .laptop-device,
    .mobile-device {
        animation: none !important;
    }
}

/* GPU Acceleration for Smooth Animations */
.laptop-device,
.mobile-device,
.info-card,
.activity-row,
.primary-metric-card,
.chart-bar,
.time-tab,
.nav-item {
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== DARK MODE SUPPORT (Optional) ===== */
@media (prefers-color-scheme: dark) {
    /* Enhance shadows for dark mode readability */
    .laptop-frame {
        box-shadow:
            0 30px 80px rgba(0, 0, 0, 0.6),
            0 15px 40px rgba(0, 0, 0, 0.5),
            0 5px 15px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
}

/* ===== SCROLL ENHANCEMENTS ===== */
.dashboard-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}

.dashboard-content::-webkit-scrollbar {
    width: 6px;
}

.dashboard-content::-webkit-scrollbar-track {
    background: transparent;
}

.dashboard-content::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 3px;
}

.dashboard-content::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* ===== ADVANCED MICRO-INTERACTIONS ===== */
/* Card Value Number Emphasize on Appear */
.card-badge-value {
    animation: badgeValueAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 2s forwards;
    opacity: 0;
    transform: scale(0.8);
}

@keyframes badgeValueAppear {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Activity Amount Highlight */
.activity-amount {
    position: relative;
}

.activity-row:hover .activity-amount {
    animation: amountHighlight 0.6s ease forwards;
}

@keyframes amountHighlight {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        text-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
    }
}

/* ===== 3D TILT EFFECT ON CARDS (Subtle) ===== */
.info-card {
    transform-style: preserve-3d;
}

.info-card:hover {
    transform: translateY(-6px) scale(1.02) rotateX(2deg) rotateY(-1deg);
}

/* ===== MODULE ICONS INTERACTION ===== */
.module-icon {
    position: relative;
}

.module-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 87, 87, 0.3), rgba(59, 130, 246, 0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.module-icon.active::before,
.module-icon:hover::before {
    opacity: 0.5;
}

/* ===== RESPONSIVE ENHANCEMENTS ===== */
@media (max-width: 1024px) {
    /* Reduce complex animations on tablets */
    .activity-icon-wrapper::before,
    .logo-icon-pro::before {
        animation: none;
    }

    /* Simplify hover effects */
    .info-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
}

@media (max-width: 768px) {
    /* Minimize animations on mobile for performance */
    .shimmerMove,
    .ambientPulse,
    .mobileAmbient,
    .iconRipple {
        animation: none !important;
    }

    /* Disable 3D effects on mobile */
    .info-card:hover {
        transform: translateY(-2px) scale(1);
    }

    .activity-row:hover {
        transform: translateX(4px);
    }

    /* Simplify shadows */
    .laptop-frame,
    .mobile-frame {
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .laptop-device,
    .mobile-device {
        animation: none !important;
        transform: none !important;
    }

    *::before,
    *::after {
        animation: none !important;
    }
}
