:root {
    --primary-color: #5EBCD1;
    --primary-hover: #3A8294;
    --background-color: #0A1929;
    --text-color: #FFFFFF;
    --overlay-color: rgba(94, 188, 209, 0.1);
    --border-color: rgba(94, 188, 209, 0.3);
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    padding-bottom: 2rem;
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgba(10, 25, 41, 0.8) 0%, rgba(10, 25, 41, 1) 100%);
    will-change: transform;
}

.animated-bg span {
    position: absolute;
    display: block;
    width: 20px;
    height: 20px;
    background: var(--overlay-color);
    animation: animate 25s linear infinite;
    bottom: -150px;
    border-radius: 50%;
    box-shadow: 0 0 5px var(--primary-color);
    filter: blur(1px);
    will-change: transform, opacity;
}

.email-container {
    background: var(--overlay-color);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.email-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.copy-button {
    transition: all 0.3s ease;
}

.copy-button:hover {
    background-color: var(--primary-hover);
}

.social-icon {
    background: var(--overlay-color);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-3px);
    background: rgba(94, 188, 209, 0.2);
}

@keyframes animate {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.5;
    }
    100% {
        transform: translateY(-1000px) rotate(720deg);
        opacity: 0;
    }
}

/* Neon Waves Animation - Optimized */
.animated-bg::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    top: 30%;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: neon-wave 12s linear infinite;
    opacity: 0.3;
    will-change: transform;
}

@keyframes neon-wave {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Floating Neon Orbs - Reduced */
.neon-glow {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    filter: blur(40px);
    opacity: 0.15;
    animation: glow-pulse 10s ease-in-out infinite;
    pointer-events: none;
    will-change: transform, opacity;
}

@keyframes glow-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.15;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.2;
    }
}

/* Neon Stars - Optimized */
.neon-star {
    position: absolute;
    width: var(--size);
    height: var(--size);
    top: var(--top);
    left: var(--left);
    background-color: var(--primary-color);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    filter: drop-shadow(0 0 5px var(--primary-color));
    opacity: 0.7;
    animation: star-pulse 4s ease-in-out infinite;
    animation-delay: var(--delay);
    z-index: -1;
    will-change: opacity, filter;
}

@keyframes star-pulse {
    0%, 100% {
        opacity: 0.7;
        filter: drop-shadow(0 0 5px var(--primary-color));
    }
    50% {
        opacity: 0.4;
        filter: drop-shadow(0 0 2px var(--primary-color));
    }
}

.animated-preview {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.animated-preview::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: currentColor;
    animation: preview-animate 10s linear infinite;
    left: 20%;
    will-change: transform, opacity;
}

@keyframes preview-animate {
    0% {
        top: 0;
        opacity: 0.5;
        transform: translateX(0) rotate(0deg);
    }
    100% {
        top: 100%;
        opacity: 0;
        transform: translateX(50px) rotate(360deg);
    }
}

.theme-option {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.theme-option::before {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: theme-animate 10s linear infinite;
    left: 15%;
    will-change: transform, opacity;
}

@keyframes theme-animate {
    0% {
        top: -20%;
        opacity: 0.3;
        transform: translateX(0) rotate(0deg);
    }
    100% {
        top: 120%;
        opacity: 0;
        transform: translateX(30px) rotate(360deg);
    }
}

.image-gallery-container {
    background: var(--overlay-color);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.image-gallery-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--primary-color);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    z-index: 10;
}

.gallery-nav-btn:hover {
    opacity: 1;
    background-color: var(--primary-hover);
}

.gallery-item {
    padding: 1rem;
}

@media (max-width: 640px) {
    body {
        padding: 1rem;
    }
    
    .email-container, .image-gallery-container {
        margin-bottom: 1rem;
        padding: 0.75rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    #themeMenu {
        width: 90vw;
        max-width: 300px;
        right: -10px;
    }
    
    /* Reduce animations on mobile for better performance */
    .animated-bg span {
        display: none;
    }
    
    .animated-bg span:nth-child(1),
    .animated-bg span:nth-child(2),
    .animated-bg span:nth-child(3),
    .animated-bg span:nth-child(4),
    .animated-bg span:nth-child(5) {
        display: block;
    }
    
    .neon-glow {
        opacity: 0.1;
        animation: none;
    }
    
    .neon-star {
        animation-duration: 6s;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .max-w-xl {
        max-width: 80%;
    }
}

@media (min-width: 1025px) {
    .max-w-xl {
        max-width: 800px;
    }
}