/* Animated Download Visual - Redesigned */
.animated-download {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 1rem;
}

.download-window {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 80px;
    background: var(--bg-primary);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    animation: windowSlide 3s ease-in-out infinite;
}

.window-header {
    height: 20px;
    background: var(--border-primary);
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    padding: 0 8px;
}

.window-dots {
    display: flex;
    gap: 4px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.dot:nth-child(1) { background: var(--accent-danger); }
.dot:nth-child(2) { background: var(--accent-warning); }
.dot:nth-child(3) { background: var(--accent-success); }

.download-content {
    padding: 12px;
    text-align: center;
}

.download-icon {
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin-bottom: 8px;
    animation: iconPulse 2s ease-in-out infinite;
}

.download-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.download-bar {
    width: 100%;
    height: 6px;
    background: var(--border-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.download-progress {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 3px;
    animation: progressFill 3s ease-in-out infinite;
}

.download-success {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: successShow 3s ease-in-out infinite;
}

.checkmark {
    width: 40px;
    height: 40px;
    background: var(--accent-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.check-line {
    position: absolute;
    background: white;
    border-radius: 2px;
}

.check-line:nth-child(1) {
    width: 8px;
    height: 2px;
    transform: rotate(45deg);
    top: 18px;
    left: 10px;
}

.check-line:nth-child(2) {
    width: 16px;
    height: 2px;
    transform: rotate(-45deg);
    top: 22px;
    left: 12px;
}

.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
}

.element {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: elementFloat 4s ease-in-out infinite;
}

.element:nth-child(1) {
    top: 10px;
    left: 20px;
    animation-delay: 0s;
}

.element:nth-child(2) {
    top: 30px;
    right: 20px;
    animation-delay: 1s;
}

.element:nth-child(3) {
    bottom: 40px;
    left: 30px;
    animation-delay: 2s;
}

/* Animated Python Visual - Iconic Python Design */
.animated-python {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 1rem;
}

.code-symbols {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.python-code {
    background: var(--accent-primary);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    animation: codeGlow 2s ease-in-out infinite;
    white-space: nowrap;
}

.python-code:nth-child(1) { animation-delay: 0s; }
.python-code:nth-child(2) { animation-delay: 0.7s; }
.python-code:nth-child(3) { animation-delay: 1.4s; }

.package-icons {
    position: absolute;
    bottom: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.python-package {
    font-size: 21px;
    animation: packageBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.python-package:nth-child(1) { animation-delay: 0s; }
.python-package:nth-child(2) { animation-delay: 0.7s; }
.python-package:nth-child(3) { animation-delay: 1.4s; }

/* Minimal fix for Python step layout - ensure it matches other steps */
.visual-step:nth-child(3) .step-content {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
}

/* Animated Database Visual - Redesigned */
.animated-database {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 1rem;
}

.model-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto;
}

.model-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: corePulse 2s ease-in-out infinite;
}

.core-glow {
    position: absolute;
    top: -5px;
    left: -5px;
    width: calc(100% + 10px);
    height: calc(100% + 10px);
    background: rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    animation: coreGlow 2s ease-in-out infinite 0.5s;
}

.model-connections {
    position: absolute;
    width: 100%;
    height: 100%;
}

.connection-line {
    position: absolute;
    width: 2px;
    height: 30px;
    background: var(--accent-secondary);
    animation: connectionFlow 2s ease-in-out infinite;
}

.connection-line:nth-child(1) {
    top: 10px;
    left: 20px;
    transform: rotate(45deg);
    animation-delay: 0s;
}

.connection-line:nth-child(2) {
    top: 20px;
    right: 20px;
    transform: rotate(-45deg);
    animation-delay: 0.5s;
}

.connection-line:nth-child(3) {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 1s;
}

.model-nodes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.node {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: nodePulse 3s ease-in-out infinite;
}

.node:nth-child(1) {
    top: 15px;
    left: 15px;
    animation-delay: 0s;
}

.node:nth-child(2) {
    top: 15px;
    right: 15px;
    animation-delay: 0.5s;
}

.node:nth-child(3) {
    bottom: 15px;
    left: 15px;
    animation-delay: 1s;
}

.node:nth-child(4) {
    bottom: 15px;
    right: 15px;
    animation-delay: 1.5s;
}

.download-status {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%) scale(1.5);
    text-align: center;
}

.status-icon {
    font-size: 1.25rem;
    color: var(--accent-primary);
    margin-bottom: 5px;
    margin-top: 30px;
    animation: iconBounce 2s ease-in-out infinite;
}

.status-icon i.fa-cloud-download-alt {
    display: block;
    margin-top: 10px;
}

.status-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.status-progress {
    position: relative;
}

.progress-circle {
    position: relative;
    width: 40px;
    height: 40px;
    margin: 0 auto;
}

.progress-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-circle path:first-child {
    fill: none;
    stroke: var(--border-secondary);
    stroke-width: 3;
}

.progress-path {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 15;
    animation: progressCircle 4s ease-in-out infinite;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-primary);
}

/* Animated Shield Visual */
.animated-shield {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
}

.shield-body {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 70px;
}

.shield-core {
    width: 100%;
    height: 100%;
    background: var(--accent-primary);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation: shieldPulse 2s ease-in-out infinite;
}

.shield-pulse {
    position: absolute;
    top: -5px;
    left: -5px;
    width: calc(100% + 10px);
    height: calc(100% + 10px);
    background: rgba(59, 130, 246, 0.3);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation: shieldPulse 2s ease-in-out infinite 0.5s;
}

.security-scanner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--accent-secondary);
    animation: scanMove 3s linear infinite;
}

.scan-line:nth-child(1) {
    top: 20px;
    animation-delay: 0s;
}

.scan-line:nth-child(2) {
    top: 50px;
    animation-delay: 1s;
}

.scan-line:nth-child(3) {
    top: 80px;
    animation-delay: 2s;
}

.protection-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ring {
    position: absolute;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: ringExpand 2s ease-in-out infinite;
}

.ring:nth-child(1) {
    width: 40px;
    height: 40px;
    animation-delay: 0s;
}

.ring:nth-child(2) {
    width: 60px;
    height: 60px;
    animation-delay: 0.5s;
}

.ring:nth-child(3) {
    width: 80px;
    height: 80px;
    animation-delay: 1s;
}

/* Animated Scanner Visual */
.animated-scanner {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
}

.scanner-device {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 40px;
}

.scanner-beam {
    width: 100%;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 2px;
    animation: beamScan 2s ease-in-out infinite;
}

.scanner-lens {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--accent-secondary);
    border-radius: 50%;
    animation: lensGlow 1.5s ease-in-out infinite;
}

.scan-results {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

.status-dot.safe {
    background: var(--accent-success);
}

.status-dot.warning {
    background: var(--accent-warning);
}

.status-dot.danger {
    background: var(--accent-danger);
}

.result-text {
    font-size: 0.6rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.scan-waves {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.wave {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: waveExpand 3s ease-in-out infinite;
}

.wave:nth-child(1) {
    animation-delay: 0s;
}

.wave:nth-child(2) {
    animation-delay: 1s;
}

.wave:nth-child(3) {
    animation-delay: 2s;
}

/* Animated Cube Visual - Virtual Environment */
.animated-cube {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 1rem;
}

.cube-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    perspective: 200px;
}

.cube {
    width: 60px;
    height: 60px;
    position: relative;
    transform-style: preserve-3d;
    animation: cubeRotate 8s linear infinite;
}

.cube-face {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(59, 130, 246, 0.8);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
}

.cube-face.front {
    transform: translateZ(30px);
}

.cube-face.back {
    transform: translateZ(-30px);
}

.cube-face.right {
    transform: rotateY(90deg) translateZ(30px);
}

.cube-face.left {
    transform: rotateY(-90deg) translateZ(30px);
}

.cube-face.top {
    transform: rotateX(90deg) translateZ(30px);
}

.cube-face.bottom {
    transform: rotateX(-90deg) translateZ(30px);
}

.cube-particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: particleFloat 4s ease-in-out infinite;
}

.particle:nth-child(1) {
    top: 20px;
    left: 30px;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    top: 30px;
    right: 20px;
    animation-delay: 1s;
}

.particle:nth-child(3) {
    bottom: 40px;
    left: 20px;
    animation-delay: 2s;
}

.particle:nth-child(4) {
    bottom: 30px;
    right: 30px;
    animation-delay: 3s;
}

.cube-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: cubeGlow 3s ease-in-out infinite;
}

.visual-text h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.visual-text p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Responsive design for visual steps */
@media (max-width: 768px) {
    .step-content {
        grid-template-columns: 1fr;
    }
    
    /* Override step 3's forced grid layout on mobile */
    .visual-step:nth-child(3) .step-content {
        grid-template-columns: 1fr !important;
    }
    
    .step-left {
        border-right: none;
        border-bottom: 1px solid var(--border-primary);
    }
    
    .step-right {
        padding: 2rem;
    }
}

/* Animation Keyframes */
@keyframes downloadBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

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

@keyframes particleFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-10px) scale(1.2); opacity: 0.7; }
}

@keyframes layerSlide {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-5px); }
}

@keyframes dataFlow {
    0%, 100% { height: 20px; opacity: 1; }
    50% { height: 30px; opacity: 0.5; }
}

@keyframes progressFill {
    0% { width: 0%; }
    50% { width: 85%; }
    100% { width: 85%; }
}

@keyframes percentageCount {
    0% { content: "0%"; }
    50% { content: "85%"; }
    100% { content: "85%"; }
}

@keyframes shieldPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes scanMove {
    0% { transform: translateX(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

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

@keyframes beamScan {
    0%, 100% { opacity: 0.5; transform: scaleX(1); }
    50% { opacity: 1; transform: scaleX(1.2); }
}

@keyframes lensGlow {
    0%, 100% { box-shadow: 0 0 10px var(--accent-secondary); }
    50% { box-shadow: 0 0 20px var(--accent-secondary); }
}

@keyframes statusPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

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

/* New keyframes for redesigned graphics */
@keyframes windowSlide {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

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

@keyframes successShow {
    0%, 60% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    70%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes elementFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-15px) scale(1.3); opacity: 0.6; }
}

/* Python Animation Keyframes */
@keyframes drawSnake {
    0% { stroke-dashoffset: 200; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 0; }
}

@keyframes headBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes eyeBlink {
    0%, 90%, 100% { opacity: 1; }
    95% { opacity: 0; }
}

@keyframes tongueFlick {
    0%, 80%, 100% { transform: scaleX(1); }
    40% { transform: scaleX(1.2); }
}

@keyframes codeGlow {
    0%, 100% { 
        box-shadow: 0 0 5px var(--accent-primary);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 15px var(--accent-primary), 0 0 25px var(--accent-primary);
        transform: scale(1.05);
    }
}

@keyframes packageBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.1); }
}

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

@keyframes coreGlow {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0.6; }
}

@keyframes connectionFlow {
    0%, 100% { height: 30px; opacity: 1; }
    50% { height: 40px; opacity: 0.7; }
}

@keyframes nodePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes progressCircle {
    0% { stroke-dashoffset: 100; }
    50% { stroke-dashoffset: 15; }
    100% { stroke-dashoffset: 15; }
}

/* Cube Animation Keyframes */
@keyframes cubeRotate {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

@keyframes particleFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-20px) scale(1.2); opacity: 0.7; }
}

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

/* Linear-style fade-in blur effect */
@keyframes fadeInBlur {
    0% {
        opacity: 0;
        filter: blur(8px);
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        filter: blur(0px);
        transform: translateY(0);
    }
}

.fade-in-blur {
    animation: fadeInBlur 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Stagger the blur effect for different elements */
.header h1 {
    animation: fadeInBlur 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
    opacity: 1 !important;
    filter: blur(0px) !important;
}

.header p {
    animation: fadeInBlur 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
    opacity: 0;
    filter: blur(8px);
}

.header-badge {
    animation: fadeInBlur 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards;
    opacity: 0;
    filter: blur(8px);
}
