/* ====================================
   CSS Custom Properties (Variables)
   ==================================== */
:root {
    /* Color Palette */
    --primary-gradient-1: #667eea;
    --primary-gradient-2: #764ba2;
    --secondary-gradient-1: #f093fb;
    --secondary-gradient-2: #f5576c;
    --accent-gradient-1: #4facfe;
    --accent-gradient-2: #00f2fe;

    /* Spacing */
    --spacing-unit: 1rem;

    /* Animation Timing */
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Effects */
    --glow-color: rgba(102, 126, 234, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

/* ====================================
   CSS Reset & Base Styles
   ==================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg,
        var(--primary-gradient-1) 0%,
        var(--primary-gradient-2) 25%,
        var(--secondary-gradient-1) 50%,
        var(--secondary-gradient-2) 75%,
        var(--accent-gradient-1) 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
}

/* ====================================
   Animated Gradient Background
   ==================================== */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ====================================
   Particle Canvas
   ==================================== */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ====================================
   Background Decorations
   ==================================== */
.bg-decoration {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}

.bg-decoration-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-gradient-1);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.bg-decoration-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary-gradient-2);
    bottom: -10%;
    right: -10%;
    animation-delay: -7s;
}

.bg-decoration-3 {
    width: 300px;
    height: 300px;
    background: var(--primary-gradient-1);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* ====================================
   Main Content
   ==================================== */
.content {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    animation: contentFadeIn 1.2s ease forwards;
    animation-delay: 0.3s;
}

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

/* ====================================
   Image Container with Glassmorphism
   ==================================== */
.image-container {
    perspective: 1000px;
    animation: scaleIn 1s var(--transition-bounce) forwards;
    animation-delay: 0.5s;
    transform: scale(0.8);
}

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

.image-wrapper {
    position: relative;
    padding: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow:
        0 8px 32px 0 rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.4s var(--transition-smooth);
    will-change: transform;
}

.image-wrapper:hover {
    transform: translateY(-8px) rotateX(2deg) rotateY(2deg);
    box-shadow:
        0 20px 60px 0 rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2),
        0 0 80px rgba(102, 126, 234, 0.4);
}

/* ====================================
   Featured Image with Effects
   ==================================== */
.featured-image {
    display: block;
    max-width: min(90vw, 800px);
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    transition: all 0.4s var(--transition-smooth);
}

.image-wrapper:hover .featured-image {
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.4)) brightness(1.05);
}

/* ====================================
   Image Glow Effect
   ==================================== */
.image-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: glowPulse 3s ease-in-out infinite;
}

.image-wrapper:hover .image-glow {
    opacity: 1;
}

@keyframes glowPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.6;
    }
}

/* ====================================
   Responsive Design
   ==================================== */
@media (max-width: 768px) {
    .image-wrapper {
        padding: 1rem;
        border-radius: 16px;
    }

    .featured-image {
        max-width: 95vw;
        max-height: 65vh;
        border-radius: 12px;
    }

    .bg-decoration-1,
    .bg-decoration-2,
    .bg-decoration-3 {
        width: 200px;
        height: 200px;
        filter: blur(60px);
    }
}

@media (max-width: 480px) {
    .content {
        padding: 1rem;
    }

    .image-wrapper {
        padding: 0.75rem;
    }

    .featured-image {
        border-radius: 8px;
    }
}

/* ====================================
   Accessibility - Reduced Motion
   ==================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .bg-decoration {
        animation: none;
    }

    body {
        animation: none;
        background: linear-gradient(135deg, var(--primary-gradient-1), var(--primary-gradient-2));
    }
}

/* ====================================
   Performance Optimizations
   ==================================== */
.image-wrapper,
.featured-image,
.bg-decoration {
    will-change: transform;
}

/* Force GPU acceleration */
.image-wrapper,
.content {
    transform: translateZ(0);
    backface-visibility: hidden;
}
