/* ===================================
   JuiceStop Premium Botcheck
   Version 3.5 - Elevated Design
   =================================== */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary Palette */
    --cyan-400: #22d3ee;
    --cyan-500: #06b6d4;
    --cyan-600: #0891b2;
    --pink-400: #f472b6;
    --pink-500: #ec4899;
    --pink-600: #db2777;
    
    /* Backgrounds */
    --bg-void: #000000;
    --bg-primary: #030303;
    --bg-elevated: #0a0a0a;
    --bg-surface: #111111;
    --bg-overlay: rgba(0, 0, 0, 0.85);
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    /* Effects */
    --glow-cyan: 0 0 30px rgba(6, 182, 212, 0.4);
    --glow-pink: 0 0 30px rgba(236, 72, 153, 0.4);
    --glow-combined: 0 0 60px rgba(6, 182, 212, 0.2), 0 0 60px rgba(236, 72, 153, 0.2);
    
    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Selection Prevention */
html, body {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--bg-void);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    cursor: default;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Ambient Background ===== */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--cyan-500) 0%, transparent 70%);
    top: -20%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--pink-500) 0%, transparent 70%);
    bottom: -20%;
    right: -10%;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--cyan-600) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
    animation-delay: -14s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.02); }
}

.orb-3 {
    animation-name: orbFloatCenter;
}

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

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(6, 182, 212, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

.noise-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ===== Page Content ===== */
.page-content {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s var(--ease-out-expo);
}

.page-content.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Zipper Container ===== */
.zipper-container {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

.zipper-container.completed {
    z-index: -1;
}

.zipper-container.completed .zipper-left {
    transform: translateX(-100%);
}

.zipper-container.completed .zipper-right {
    transform: translateX(100%);
}

.zipper-container.completed .zipper-track,
.zipper-container.completed .zipper-pull-wrapper,
.zipper-container.completed .verification-panel {
    opacity: 0;
    pointer-events: none;
}

/* ===== Zipper Panels ===== */
.zipper-panel {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    z-index: 11;
    transition: transform 0.9s var(--ease-out-expo);
    overflow: hidden;
}

.zipper-left {
    left: 0;
}

.zipper-right {
    right: 0;
}

.panel-inner {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #050508 50%, #08080c 100%);
}

.panel-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
}

.panel-edge {
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    z-index: 5;
}

.left-edge {
    right: 0;
    background: linear-gradient(180deg, 
        transparent 0%,
        rgba(6, 182, 212, 0.3) 20%,
        rgba(236, 72, 153, 0.3) 50%,
        rgba(6, 182, 212, 0.3) 80%,
        transparent 100%
    );
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

.right-edge {
    left: 0;
    background: linear-gradient(180deg, 
        transparent 0%,
        rgba(236, 72, 153, 0.3) 20%,
        rgba(6, 182, 212, 0.3) 50%,
        rgba(236, 72, 153, 0.3) 80%,
        transparent 100%
    );
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.3);
}

/* ===== Teeth ===== */
.teeth-container {
    position: absolute;
    top: 0;
    width: 28px;
    height: 100%;
    z-index: 6;
}

.teeth-left-container {
    right: 0;
}

.teeth-right-container {
    left: 0;
}

.teeth-track {
    position: absolute;
    top: 60px;
    width: 100%;
    height: calc(100% - 60px);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
}

.tooth {
    flex: 0 0 auto;
    height: 16px;
    background: linear-gradient(90deg, #3a3a3a 0%, #555555 50%, #3a3a3a 100%);
    border-radius: 3px;
    position: relative;
    transition: transform 0.5s var(--ease-spring), opacity 0.4s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.teeth-left-container .tooth {
    border-radius: 0 4px 4px 0;
    margin-left: 4px;
    transform-origin: left center;
}

.teeth-right-container .tooth {
    border-radius: 4px 0 0 4px;
    margin-right: 4px;
    transform-origin: right center;
}

.tooth::before {
    content: '';
    position: absolute;
    top: 2px;
    width: 8px;
    height: 12px;
    background: linear-gradient(180deg, #666666 0%, #444444 100%);
    border-radius: 2px;
}

.teeth-left-container .tooth::before {
    right: 4px;
}

.teeth-right-container .tooth::before {
    left: 4px;
}

.tooth.open {
    opacity: 0.6;
}

.teeth-left-container .tooth.open {
    transform: translateX(-12px) rotateY(30deg);
}

.teeth-right-container .tooth.open {
    transform: translateX(12px) rotateY(-30deg);
}

/* ===== Zipper Track ===== */
.zipper-track {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 100%;
    z-index: 12;
    transition: opacity 0.6s ease;
}

.track-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, 
        rgba(6, 182, 212, 0.2) 0%,
        rgba(236, 72, 153, 0.15) 50%,
        rgba(6, 182, 212, 0.2) 100%
    );
    filter: blur(8px);
}

.zipper-closed {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 0;
    z-index: 13;
    overflow: hidden;
}

.closed-line {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, 
        #888888 0%, 
        #666666 25%, 
        #888888 50%, 
        #666666 75%, 
        #888888 100%
    );
    background-size: 100% 20px;
    animation: closedSlide 2s linear infinite;
}

@keyframes closedSlide {
    0% { background-position: 0 0; }
    100% { background-position: 0 20px; }
}

/* ===== Zipper Pull ===== */
.zipper-pull-wrapper {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    z-index: 999;
    cursor: grab;
    pointer-events: auto;
    touch-action: none;
    transition: opacity 0.6s ease;
}

.zipper-pull-wrapper:active {
    cursor: grabbing;
}

.pull-glow {
    position: absolute;
    width: 120px;
    height: 120px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(6, 182, 212, 0.4) 0%, transparent 60%);
    border-radius: 50%;
    animation: pullGlowPulse 2s ease-in-out infinite;
    pointer-events: none;
}

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

.pull-body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.15s ease;
}

.zipper-pull-wrapper:hover .pull-body {
    transform: scale(1.05);
}

.zipper-pull-wrapper:active .pull-body {
    transform: scale(0.98);
}

.pull-ring {
    width: 40px;
    height: 24px;
    border: 3px solid #888888;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    position: relative;
    background: linear-gradient(180deg, #666666 0%, #444444 100%);
}

.ring-inner {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 12px;
    background: var(--bg-primary);
    border-radius: 10px 10px 0 0;
}

.pull-tab {
    width: 50px;
    height: 60px;
    background: linear-gradient(180deg, 
        #777777 0%, 
        #555555 20%, 
        #666666 40%,
        #444444 100%
    );
    border-radius: 6px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-texture {
    position: absolute;
    inset: 4px;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 3px,
        rgba(0, 0, 0, 0.15) 3px,
        rgba(0, 0, 0, 0.15) 4px
    );
    border-radius: 4px;
}

.pull-icon {
    width: 24px;
    height: 24px;
    stroke: var(--cyan-400);
    position: relative;
    z-index: 1;
    animation: bounceArrow 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.5));
}

@keyframes bounceArrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

.pull-shadow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 10px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.4) 0%, transparent 70%);
}

/* ===== Verification Panel ===== */
.verification-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    width: 90%;
    max-width: 380px;
    padding: 40px 32px;
    background: linear-gradient(165deg, 
        rgba(15, 15, 18, 0.95) 0%, 
        rgba(10, 10, 12, 0.98) 100%
    );
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(40px);
    box-shadow: 
        0 0 0 1px rgba(6, 182, 212, 0.1),
        0 25px 50px -12px rgba(0, 0, 0, 0.6),
        0 0 100px rgba(6, 182, 212, 0.1),
        0 0 100px rgba(236, 72, 153, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    transition: opacity 0.6s ease;
}

/* Logo Container */
.logo-container {
    position: relative;
    width: 80px;
    height: 80px;
}

.logo-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: logoRingSpin 8s linear infinite;
}

@keyframes logoRingSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ring-segment {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
}

.ring-segment:nth-child(1) {
    border-top-color: var(--cyan-400);
    border-right-color: var(--cyan-400);
}

.ring-segment:nth-child(2) {
    transform: rotate(120deg);
    border-top-color: var(--pink-400);
    border-right-color: var(--pink-400);
}

.ring-segment:nth-child(3) {
    transform: rotate(240deg);
    border-top-color: var(--cyan-500);
    border-right-color: var(--cyan-500);
}

.logo-icon {
    position: absolute;
    inset: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
    border-radius: 50%;
}

.logo-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--cyan-400);
}

.logo-icon .success-icon,
.logo-icon .failure-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 28px;
    font-weight: 600;
    border-radius: 50%;
    animation: iconPop 0.5s var(--ease-spring);
}

@keyframes iconPop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.logo-icon .success-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

.logo-icon .failure-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
}

/* Brand */
.brand-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
}

.brand-secure {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--cyan-400);
    padding: 3px 8px;
    background: rgba(6, 182, 212, 0.15);
    border-radius: 4px;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Instructions */
.instructions-container {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(236, 72, 153, 0.05) 100%);
    border-radius: 14px;
    border: 1px solid rgba(6, 182, 212, 0.2);
    width: 100%;
}

.instruction-icon {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.instruction-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--cyan-400);
    animation: bounceArrow 1.5s ease-in-out infinite;
}

.pulse-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--cyan-400);
    border-radius: 50%;
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

.instruction-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Spinner for loading state */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(6, 182, 212, 0.2);
    border-top-color: var(--cyan-400);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Status Text */
.status-text {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

/* Progress Section */
.progress-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--cyan-400) 0%, var(--pink-400) 100%);
    border-radius: 10px;
    position: relative;
    transition: width 0.2s ease;
}

.progress-glow {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(4px);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    color: var(--cyan-400);
}

.progress-status {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

/* Security Indicator */
.security-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    background: var(--cyan-400);
    border-radius: 50%;
    animation: indicatorPulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

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

.indicator-text {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* Version Tag */
.version-tag {
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.5;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .verification-panel {
        padding: 32px 24px;
        gap: 20px;
        max-width: 340px;
    }

    .logo-container {
        width: 70px;
        height: 70px;
    }

    .logo-icon svg {
        width: 24px;
        height: 24px;
    }

    .instructions-container {
        padding: 14px 18px;
        gap: 12px;
    }

    .instruction-text {
        font-size: 14px;
    }

    .pull-tab {
        width: 44px;
        height: 52px;
    }

    .pull-ring {
        width: 36px;
        height: 20px;
    }
}

/* ===== High Contrast Mode ===== */
@media (prefers-contrast: high) {
    .verification-panel {
        border-color: var(--cyan-400);
    }
    
    .tooth {
        background: #666666;
    }
}

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