/* Main Cannabis Dispensary Styling */

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

html {
    font-size: 19.2px;
    line-height: 1.5;
}

body {
    font-family: 'Jersey 10', monospace;
    color: #ffffff;
    overflow-x: hidden;
    user-select: none;
    cursor: crosshair; /* Retro crosshair cursor */
}

/* Cannabis Retro Background Gradient with Pink and Purple */
.bg-retro-gradient {
    background: linear-gradient(180deg, 
        #0f4a2e 0%,    /* Dark forest green */
        #1a0a2e 15%,   /* Dark purple */
        #2d5a3d 30%,   /* Medium green */
        #4a1a4a 45%,   /* Dark pink/purple */
        #1a2332 60%,   /* Charcoal blue-green */
        #6b21a8 75%,   /* Purple */
        #0f4a2e 100%   /* Dark forest green */
    );
    background-size: 400% 400%;
    animation: gradientShift 20s ease-in-out infinite alternate;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 25%; }
    50% { background-position: 0% 100%; }
    75% { background-position: 100% 75%; }
    100% { background-position: 0% 50%; }
}

/* Pixel Perfect Layout */
.pixel-perfect {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Starfield Container */
.starfield-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* SVG Star Fallback */
.starfield-fallback {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

/* Scan Lines Effect */
.scanlines-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        transparent 50%,
        rgba(0, 0, 0, 0.1) 50%
    );
    background-size: 100% 4px;
    animation: scanlines 0.1s linear infinite;
    pointer-events: none;
    z-index: 5;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* CRT Monitor Flicker Effect */
.bg-retro-gradient::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.02);
    animation: flicker 0.15s infinite linear;
    pointer-events: none;
    z-index: 2;
}

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

/* Logo Styling */
.logo-text {
    font-family: "Jersey 10", sans-serif;
    color: #ffffff;
    text-shadow: 
        0 0 3px #065f46,       /* Dark green inner glow */
        0 0 6px #064e3b,       /* Darker green */
        0 0 9px #047857,       /* Medium dark green */
        0 0 12px #065f46,      /* Dark green outer */
        1px 1px 2px rgba(0, 0, 0, 0.9),  /* Strong shadow */
        2px 2px 4px rgba(0, 0, 0, 0.8);  /* Additional shadow */
    animation: logoGlow 3s ease-in-out infinite alternate;
    margin-bottom: 2rem;
    text-transform: none;
    letter-spacing: 4px;
    font-weight: normal;
    filter: drop-shadow(0 0 4px #047857) 
            drop-shadow(0 0 8px #065f46)
            drop-shadow(0 0 12px #064e3b);
}

@media (max-width: 768px) {
    .logo-text {
        letter-spacing: 3px;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo-text {
        letter-spacing: 2px;
        margin-bottom: 1rem;
        font-size: 1.2em;
    }
}

/* Subtitle Styling */
.subtitle-text {
    font-size: clamp(0.84rem, 3vw, 1.2rem);
    color: #d1d5db;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    margin-bottom: 3rem;
    max-width: 600px;
    line-height: 1.8;
}

/* Cannabis Leaf Decorations */
.cannabis-decoration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.cannabis-leaf {
    position: absolute;
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
}

.left-leaf {
    left: -80px;
    animation-delay: 0s;
}

.right-leaf {
    right: -80px;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }
    50% { 
        transform: translateY(-20px) rotate(5deg);
        opacity: 0.6;
    }
}

/* Pixel Buttons with Cannabis Theme */
.pixel-button {
    font-family: 'Jersey 10', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 3px solid;
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    transition: all 0.15s ease;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.pixel-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 0 10px rgba(34, 197, 94, 0.6),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

.pixel-button:active {
    transform: translateY(0);
    box-shadow: 
        0 0 5px rgba(34, 197, 94, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.3);
}

.pixel-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.pixel-button:hover::before {
    left: 100%;
}

/* Loading Animation with Cannabis Theme */
.loading-dots {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    border: 2px solid #10b981;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.loading-dot {
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* DOOM-style Hit Splat Effect */
.hit-splat {
    position: fixed;
    left: 0;
    top: 0;
    width: 50px;
    height: 50px;
    pointer-events: none;
    z-index: 1000;
    transform: translate(-50%, -50%);
}

.hit-splat::before,
.hit-splat::after {
    content: '';
    position: absolute;
    background: #8b0000; /* Dark blood red */
    border-radius: 0; /* Make it more angular/pixelated */
    animation: doomSplatExplosion 0.8s ease-out forwards;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.hit-splat::before {
    width: 50px;
    height: 30px;
    opacity: 0.9;
    border-radius: 3px; /* Slightly rounded for retro feel */
    background: radial-gradient(ellipse at center, #8b0000 0%, #5c0000 60%, #2c0000 100%);
}

.hit-splat::after {
    width: 25px;
    height: 25px;
    top: 12px;
    left: 12px;
    opacity: 1;
    border-radius: 2px;
    background: radial-gradient(circle, #a00000 0%, #600000 70%, #300000 100%);
    animation: doomSplatCenter 0.6s ease-out forwards;
}

/* Additional splat particles for more impact */
.hit-splat .particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #5c0000;
    border-radius: 1px;
    animation: doomSplatParticle 1s ease-out forwards;
}

.hit-splat .particle:nth-child(1) { top: -5px; left: 10px; animation-delay: 0.1s; }
.hit-splat .particle:nth-child(2) { top: 5px; right: -3px; animation-delay: 0.15s; }
.hit-splat .particle:nth-child(3) { bottom: -2px; left: 5px; animation-delay: 0.2s; }
.hit-splat .particle:nth-child(4) { bottom: 8px; right: 8px; animation-delay: 0.25s; }

@keyframes doomSplatExplosion {
    0% {
        transform: scale(0.1) rotate(0deg);
        opacity: 1;
    }
    30% {
        transform: scale(1.1) rotate(5deg);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.8) rotate(-10deg);
        opacity: 0;
    }
}

@keyframes doomSplatCenter {
    0% {
        transform: scale(0.5) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(2.5) rotate(180deg);
        opacity: 0;
    }
}

@keyframes doomSplatParticle {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: scale(0.3) translate(var(--particle-x, 20px), var(--particle-y, -15px));
        opacity: 0;
    }
}

/* Faint Background Static */
.background-static {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 1px,
            rgba(255, 255, 255, 0.02) 1px,
            rgba(255, 255, 255, 0.02) 2px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 1px,
            rgba(255, 255, 255, 0.015) 1px,
            rgba(255, 255, 255, 0.015) 2px
        );
    pointer-events: none;
    z-index: 1;
    opacity: 0.3;
    animation: backgroundStatic 2s linear infinite;
}

.background-static.muted {
    display: none;
}

@keyframes backgroundStatic {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-1px, 1px); }
    50% { transform: translate(1px, -1px); }
    75% { transform: translate(-1px, -1px); }
    100% { transform: translate(0, 0); }
}

/* Mute Toggle Icon */
.mute-toggle {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #10b981;
    border-radius: 6px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.mute-toggle:hover {
    background: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.mute-toggle svg {
    width: 20px;
    height: 20px;
    fill: #10b981;
    transition: all 0.3s ease;
}

.mute-toggle.muted svg {
    fill: #dc2626;
}

.mute-toggle.muted:hover {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.2);
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}
.static-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.03) 2px,
            rgba(255, 255, 255, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.02) 2px,
            rgba(255, 255, 255, 0.02) 4px
        );
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    animation: staticNoise 0.1s steps(2) infinite;
}

@keyframes staticNoise {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-1px, 1px); }
    50% { transform: translate(1px, -1px); }
    75% { transform: translate(-1px, -1px); }
    100% { transform: translate(0, 0); }
}

.static-active {
    opacity: 1 !important;
    animation: staticBurst 0.3s steps(3) infinite;
}

@keyframes staticBurst {
    0% { 
        opacity: 0.3;
        filter: brightness(1.2) contrast(1.1);
    }
    50% { 
        opacity: 0.7;
        filter: brightness(1.5) contrast(1.3);
    }
    100% { 
        opacity: 0.2;
        filter: brightness(1.1) contrast(1.05);
    }
}

/* Cannabis-specific Background Particles with Pink/Purple tones */
.bg-retro-gradient::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(34, 197, 94, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(22, 163, 74, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 60% 20%, rgba(236, 72, 153, 0.08) 0%, transparent 40%), /* Pink accents */
        radial-gradient(circle at 30% 60%, rgba(168, 85, 247, 0.08) 0%, transparent 40%), /* Purple accents */
        radial-gradient(circle at 85% 35%, rgba(219, 39, 119, 0.06) 0%, transparent 35%); /* Deep pink */
    pointer-events: none;
    z-index: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo-text {
        font-size: clamp(2.4rem, 10.8vw, 4.2rem);
        margin-bottom: 1.5rem;
    }
    
    .subtitle-text {
        font-size: clamp(0.72rem, 3.6vw, 1.08rem);
        margin-bottom: 2rem;
        padding: 0 1rem;
    }
    
    .pixel-button {
        font-size: 0.84rem;
        padding: 0.6rem 1.5rem;
    }
    
    .button-group {
        gap: 1rem;
    }
    
    .cannabis-leaf {
        display: none;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: clamp(1.8rem, 9.6vw, 3rem);
        line-height: 1.4;
    }
    
    .pixel-button {
        font-size: 0.72rem;
        padding: 0.5rem 1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .bg-retro-gradient,
    .scanlines-overlay,
    .bg-retro-gradient::before,
    .bg-retro-gradient::after,
    .logo-text,
    .pixel-button,
    .loading-dot,
    .cannabis-leaf {
        animation: none !important;
    }
    
    .starfield-container {
        display: none;
    }
    
    .starfield-fallback {
        opacity: 0.8;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-retro-gradient {
        background: #000000;
    }
    
    .logo-text {
        color: #ffffff;
        text-shadow: none;
    }
    
    .subtitle-text {
        color: #ffffff;
    }
}

/* Print styles */
@media print {
    .scanlines-overlay,
    .starfield-container,
    .loading-container,
    .cannabis-decoration {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .logo-text,
    .subtitle-text {
        text-shadow: none !important;
        color: black !important;
    }
}