/* ===================================
   ANIMATIONS & EFFECTS
   AppSec Landing - Codeby School
   =================================== */

/* ===========================
   KEYFRAME ANIMATIONS
   =========================== */

/* Scan effect for hero */
@keyframes scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Gradient text animation */
@keyframes gradient {
    to { background-position: 200% center; }
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Glow animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.8),
                    0 0 30px rgba(0, 255, 136, 0.6);
    }
}

/* Float animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Fade in */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Slide in up */
@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Cursor blink */
@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Terminal typing */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* Terminal blink */
@keyframes blink {
    0%, 50% { border-color: var(--primary-green); }
    51%, 100% { border-color: transparent; }
}

/* Stream started glow (for countdown) */
@keyframes streamStartedGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(0, 255, 136, 0.3),
                    0 0 25px rgba(0, 255, 136, 0.2),
                    inset 0 0 15px rgba(0, 255, 136, 0.1);
    }
    50% {
        box-shadow: 0 0 25px rgba(0, 255, 136, 0.6),
                    0 0 40px rgba(0, 255, 136, 0.4),
                    inset 0 0 20px rgba(0, 255, 136, 0.2);
    }
}

/* Stream started pulse */
@keyframes streamStartedPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Spin (for loader) */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===========================
   ANIMATION CLASSES
   =========================== */

/* Fade in */
.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Slide in up */
.slide-in-up {
    animation: slideInUp 0.6s ease;
}

/* Pulse */
.pulse {
    animation: pulse 2s infinite;
}

/* Glow */
.glow {
    animation: glow 2s infinite;
}

/* Float */
.float {
    animation: float 3s ease-in-out infinite;
}

/* ===========================
   SCROLL ANIMATIONS
   =========================== */

/* Elements with this class will animate when scrolled into view */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations for children */
.stagger-animation > * {
    opacity: 0;
    animation: slideInUp 0.5s ease forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }

/* ===========================
   TRANSITION UTILITIES
   =========================== */

.transition-fast { transition: all var(--transition-fast); }
.transition-base { transition: all var(--transition-base); }
.transition-slow { transition: all var(--transition-slow); }

/* ===========================
   HOVER EFFECTS
   =========================== */

/* Lift on hover */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* Scale on hover */
.hover-scale {
    transition: transform var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Glow on hover */
.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

/* Border color on hover */
.hover-border {
    transition: border-color var(--transition-base);
}

.hover-border:hover {
    border-color: var(--primary-green);
}

/* ===========================
   SPECIAL EFFECTS
   =========================== */

/* Spinner/Loader */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-green);
    border-radius: var(--border-radius-full);
    animation: spin 1s linear infinite;
}

/* Shimmer effect (for loading states) */
.shimmer {
    background: linear-gradient(
        90deg,
        var(--card-bg) 25%,
        var(--border-color) 50%,
        var(--card-bg) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* Gradient border effect */
.gradient-border {
    position: relative;
    background: var(--card-bg);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--border-radius-lg);
    padding: 2px;
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* ===========================
   PARTICLES (Optional)
   =========================== */

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: var(--primary-green);
    border-radius: var(--border-radius-full);
    opacity: 0.3;
    animation: float 6s infinite ease-in-out;
}
