/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0a;
    color: #e0e0e0;
    font-family: 'Roboto Mono', monospace;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 50% 50%, #111 0%, #0a0a0a 100%);
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/><feColorMatrix type="saturate" values="0"/></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.15"/></svg>');
    pointer-events: none;
    z-index: -1;
}

/* INSANE BACKGROUND EFFECTS */
.bg-particles {
    position: fixed;
    inset: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(0, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 0, 255, 0.3), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(0, 255, 157, 0.3), transparent),
        radial-gradient(2px 2px at 80% 10%, rgba(0, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 90% 60%, rgba(255, 0, 255, 0.3), transparent),
        radial-gradient(2px 2px at 33% 50%, rgba(0, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 70% 40%, rgba(0, 255, 157, 0.3), transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: particleFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.grid-overlay {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridPulse 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.floating-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.4), transparent);
    top: -100px;
    left: -100px;
    animation: floatOrb1 15s ease-in-out infinite;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 0, 255, 0.3), transparent);
    bottom: -150px;
    right: -150px;
    animation: floatOrb2 20s ease-in-out infinite;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(0, 255, 157, 0.3), transparent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: floatOrb3 18s ease-in-out infinite;
}

#cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.container {
    max-width: 1260px;
    margin: 0 auto;
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 2.7rem;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* HERO */
.hero {
    text-align: center;
    padding: 3.6rem 0 1.8rem;
    animation: fadeInUp 1.2s ease-out;
}

.title {
    font-family: 'Orbitron', sans-serif;
    font-size: 4.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #00f5ff, #ff00ff, #00ff9d, #00f5ff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.15em;
    text-shadow: 0 0 40px rgba(0, 255, 255, 0.4);
    animation: rainbowShift 3s linear infinite, titleGlitch 5s ease-in-out infinite;
    position: relative;
}

.title::before,
.title::after {
    content: 'insane-particles';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #00f5ff, #ff00ff, #00ff9d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
}

.title::before {
    animation: glitchTop 3s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}

.title::after {
    animation: glitchBottom 2.5s infinite;
    clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
}

.subtitle {
    font-size: 1.26rem;
    opacity: 0.8;
    margin-top: 0.9rem;
    animation: fadeInUp 1.4s ease-out;
}

/* BUTTONS */
.buttons-container {
    display: flex;
    gap: 0.9rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.8rem;
}

.effect-btn {
    padding: 0.81rem 1.62rem;
    border: none;
    border-radius: 50px;
    background: rgba(20, 20, 30, 0.6);
    backdrop-filter: blur(12px);
    color: #e0e0e0;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.effect-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(0, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.effect-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 45%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.1) 55%,
        transparent 100%
    );
    transform: translateX(-200%) skewX(-15deg);
    animation: holographicShine 6s ease-in-out infinite;
}

.effect-btn:hover::before {
    transform: translateX(100%);
}

.effect-btn:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 255, 255, 0.2);
    border-color: #00f5ff;
}

.effect-btn.active {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(255, 0, 255, 0.2));
    border-color: #00f5ff;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
    color: white;
}

/* PREVIEW */
.preview-container {
    position: relative;
    width: 100%;
    height: 540px;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(15, 15, 25, 0.6);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: pulseGlow 4s infinite alternate ease-in-out;
}

#particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.preview-glow {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    box-shadow: inset 0 0 60px rgba(0, 255, 255, 0.1);
    pointer-events: none;
}

/* CODE PANEL */
.code-panel {
    background: rgba(15, 15, 25, 0.6);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(0, 255, 255, 0.3);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 0, 255, 0.2);
    animation: codePanelGlow 3s ease-in-out infinite alternate;
    position: relative;
}

.code-panel::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #ff00ff, #00f5ff, #ff00ff);
    background-size: 400% 400%;
    border-radius: 20px;
    z-index: -1;
    animation: gradientRotate 10s ease infinite;
    opacity: 0.2;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 20, 0.8);
    padding: 0.9rem 1.35rem;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.code-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.99rem;
    color: #00f5ff;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.code-actions {
    display: flex;
    gap: 0.9rem;
}

.copy-btn,
.download-btn {
    padding: 0.72rem 1.35rem;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    transition: all 0.3s ease;
}

.copy-btn {
    background: linear-gradient(135deg, #00f5ff, #0099ff);
}

.copy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

.copy-btn.copied {
    background: #00ff9d;
}

.download-btn {
    background: linear-gradient(135deg, #ff00ff, #ff0099);
}

.download-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.5);
}

.download-btn.downloaded {
    background: #00ff9d;
}

.code-content {
    height: 360px;
    overflow-y: auto;
    padding: 1.8rem;
    position: relative;
}

.code-content::-webkit-scrollbar {
    width: 9px;
}

.code-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.code-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 5px;
}

.code-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.5);
}

#code-display {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.855rem;
    line-height: 1.6;
    white-space: pre;
    color: #e0e0e0;
    opacity: 0;
    animation: fadeInCode 0.8s ease forwards;
}

/* ANIMATIONS */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    from {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 0 60px rgba(0, 255, 255, 0.1);
    }
    to {
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), inset 0 0 80px rgba(0, 255, 255, 0.15);
    }
}

@keyframes fadeInCode {
    to {
        opacity: 1;
    }
}

/* INSANE ANIMATIONS */
@keyframes particleFloat {
    0%, 100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
}

@keyframes gridPulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

@keyframes floatOrb1 {
    0%, 100% {
        transform: translate(0, 0);
    }
    33% {
        transform: translate(100px, -50px);
    }
    66% {
        transform: translate(-50px, 100px);
    }
}

@keyframes floatOrb2 {
    0%, 100% {
        transform: translate(0, 0);
    }
    33% {
        transform: translate(-80px, 80px);
    }
    66% {
        transform: translate(80px, -80px);
    }
}

@keyframes floatOrb3 {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
    }
}

@keyframes rainbowShift {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

@keyframes titleGlitch {
    0%, 90%, 100% {
        transform: translateX(0);
    }
    92% {
        transform: translateX(-5px) skew(-2deg);
    }
    94% {
        transform: translateX(5px) skew(2deg);
    }
    96% {
        transform: translateX(-3px) skew(-1deg);
    }
}

@keyframes glitchTop {
    0%, 90%, 100% {
        opacity: 0;
        transform: translateX(0);
    }
    92% {
        opacity: 0.8;
        transform: translateX(-10px);
    }
}

@keyframes glitchBottom {
    0%, 90%, 100% {
        opacity: 0;
        transform: translateX(0);
    }
    94% {
        opacity: 0.8;
        transform: translateX(10px);
    }
}

@keyframes holographicShine {
    0% {
        transform: translateX(-200%) skewX(-15deg);
    }
    100% {
        transform: translateX(200%) skewX(-15deg);
    }
}

@keyframes gradientRotate {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes codePanelGlow {
    from {
        box-shadow: 
            0 20px 60px rgba(0, 0, 0, 0.5),
            0 0 20px rgba(255, 0, 255, 0.2);
    }
    to {
        box-shadow: 
            0 20px 60px rgba(0, 0, 0, 0.5),
            0 0 40px rgba(255, 0, 255, 0.4);
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 3.15rem;
    }
    .preview-container {
        height: 360px;
    }
    .buttons-container {
        flex-direction: column;
        align-items: center;
    }
    .effect-btn {
        width: 80%;
    }
    .code-header {
        flex-direction: column;
        gap: 0.9rem;
        align-items: stretch;
    }
    .code-actions {
        flex-direction: column;
        width: 100%;
    }
    .copy-btn,
    .download-btn {
        width: 100%;
    }
}