/* ===================== ENHANCED DESIGN SYSTEM ===================== */

/* Multi-tier Glassmorphism */
.glass-tier-1 {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass-tier-1 {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-tier-2 {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass-tier-2 {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-tier-3 {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(30px) saturate(220%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dark .glass-tier-3 {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Enhanced Stat Cards */
.stat-card-enhanced {
    position: relative;
    padding: 1.5rem;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .stat-card-enhanced {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
            rgb(var(--a1)),
            rgb(var(--a2)),
            rgb(var(--a3)));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card-enhanced:hover::before {
    opacity: 1;
}

.stat-card-enhanced:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
}

.dark .stat-card-enhanced:hover {
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.4);
}

.stat-card-enhanced .stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-center;
    background: linear-gradient(135deg, rgba(var(--a1), 0.1), rgba(var(--a2), 0.05));
    transition: all 0.3s ease;
}

.stat-card-enhanced:hover .stat-icon {
    transform: rotate(10deg) scale(1.1);
    background: linear-gradient(135deg, rgba(var(--a1), 0.2), rgba(var(--a2), 0.1));
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, rgb(var(--a1)), rgb(var(--a2)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Floating Elements */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.floating-element {
    animation: float 3s ease-in-out infinite;
}

.floating-slow {
    animation: float 6s ease-in-out infinite;
}

/* Gradient Borders */
.gradient-border {
    position: relative;
    background: linear-gradient(var(--tw-gradient-stops));
    border-radius: 1.5rem;
    padding: 2px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    padding: 2px;
    background: linear-gradient(135deg,
            rgba(var(--a1), 0.5),
            rgba(var(--a2), 0.5),
            rgba(var(--a3), 0.5));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.gradient-border-animated {
    background: linear-gradient(90deg,
            rgba(var(--a1), 0.3),
            rgba(var(--a2), 0.3),
            rgba(var(--a3), 0.3),
            rgba(var(--a1), 0.3));
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.shimmer-effect {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

.dark .shimmer-effect {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 100%);
}

/* Data Visualization Cards */
.data-viz-card {
    position: relative;
    border-radius: 1.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.dark .data-viz-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.data-viz-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle,
            rgba(var(--a1), 0.05) 0%,
            transparent 70%);
    pointer-events: none;
}

/* Modern Timeline */
.timeline-modern {
    position: relative;
    padding-left: 2rem;
}

.timeline-modern::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg,
            rgba(var(--a1), 0.3),
            rgba(var(--a2), 0.3),
            rgba(var(--a3), 0.3));
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgb(var(--a1)), rgb(var(--a2)));
    box-shadow: 0 0 0 4px rgba(var(--a1), 0.1);
    z-index: 1;
}

.timeline-item:hover::before {
    transform: scale(1.3);
    box-shadow: 0 0 0 8px rgba(var(--a1), 0.15);
}

/* Gradient Badges */
.badge-gradient {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgba(var(--a1), 0.15), rgba(var(--a2), 0.1));
    border: 1px solid rgba(var(--a1), 0.2);
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(var(--a1));
    transition: all 0.2s ease;
}

.badge-gradient:hover {
    background: linear-gradient(135deg, rgba(var(--a1), 0.25), rgba(var(--a2), 0.15));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--a1), 0.2);
}

.badge-gradient-success {
    --a1: 16 185 129;
    --a2: 34 197 94;
}

.badge-gradient-warning {
    --a1: 245 158 11;
    --a2: 249 115 22;
}

.badge-gradient-error {
    --a1: 239 68 68;
    --a2: 244 63 94;
}

.badge-gradient-info {
    --a1: 59 130 246;
    --a2: 99 102 241;
}

/* Hover Lift Effects */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.2);
}

.dark .hover-lift:hover {
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
}

/* Stagger Animation */
@keyframes stagger-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-item {
    opacity: 0;
    animation: stagger-fade-in 0.5s ease forwards;
}

.stagger-item:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-item:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-item:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-item:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-item:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-item:nth-child(6) {
    animation-delay: 0.6s;
}

/* Hero Gradient Backgrounds */
.hero-gradient {
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center,
            rgba(var(--a1), 0.15) 0%,
            rgba(var(--a2), 0.1) 25%,
            rgba(var(--a3), 0.05) 50%,
            transparent 70%);
    animation: gradient-rotate 20s linear infinite;
}

@keyframes gradient-rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Pulsing Glow */
@keyframes pulse-glow-enhanced {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(var(--a1), 0.4);
    }

    50% {
        box-shadow: 0 0 40px rgba(var(--a1), 0.6), 0 0 60px rgba(var(--a2), 0.3);
    }
}

.pulse-glow-enhanced {
    animation: pulse-glow-enhanced 2s ease-in-out infinite;
}

/* Morphing Transitions */
.morph-transition {
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* Filter Panel Styles */
.filter-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
}

.dark .filter-panel {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.filter-panel.open {
    right: 0;
}

/* Activity Heatmap */
.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.heatmap-cell:hover {
    transform: scale(1.2);
    z-index: 10;
}

.heatmap-level-0 {
    background: rgba(var(--a1), 0.1);
}

.heatmap-level-1 {
    background: rgba(var(--a1), 0.3);
}

.heatmap-level-2 {
    background: rgba(var(--a1), 0.5);
}

.heatmap-level-3 {
    background: rgba(var(--a1), 0.7);
}

.heatmap-level-4 {
    background: rgba(var(--a1), 0.9);
}