/* ============================================
   AI Tech College - Animations & Effects
   ============================================ */

/* === Particle Animation === */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    10% {
        opacity: 0.6;
        transform: scale(1);
    }
    90% {
        opacity: 0.2;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(0.5);
    }
}

/* === Glowing Orb Effect === */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: orbPulse 8s ease-in-out infinite alternate;
}

@keyframes orbPulse {
    0% { transform: scale(1); opacity: 0.2; }
    100% { transform: scale(1.3); opacity: 0.4; }
}

/* === Card Shimmer === */
.feature-card::after,
.program-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(108, 99, 255, 0.03) 50%,
        transparent 60%
    );
    transform: rotate(0deg);
    animation: shimmer 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

/* === Typing effect for hero === */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--accent);
    margin-left: 4px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

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

/* === Gradient Border Animation === */
.gradient-border {
    position: relative;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gradient-border:hover::before {
    opacity: 1;
}

/* === Ripple Effect === */
.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.3) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:active::after {
    opacity: 1;
}

/* === Stagger Children Animation === */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-children.animated > *:nth-child(1) { animation: staggerIn 0.5s ease 0.0s forwards; }
.stagger-children.animated > *:nth-child(2) { animation: staggerIn 0.5s ease 0.1s forwards; }
.stagger-children.animated > *:nth-child(3) { animation: staggerIn 0.5s ease 0.2s forwards; }
.stagger-children.animated > *:nth-child(4) { animation: staggerIn 0.5s ease 0.3s forwards; }
.stagger-children.animated > *:nth-child(5) { animation: staggerIn 0.5s ease 0.4s forwards; }
.stagger-children.animated > *:nth-child(6) { animation: staggerIn 0.5s ease 0.5s forwards; }

@keyframes staggerIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Magnetic hover === */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Smooth section transitions === */
.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--border),
        transparent
    );
}

/* === Number counter animation === */
.stat-number {
    display: inline-block;
}

/* === Nav link underline animation === */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link {
    position: relative;
}

.nav-link:hover::after {
    width: 60%;
}

/* === Noise texture overlay === */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* === Smooth scrollbar (webkit) === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* === Selection color === */
::selection {
    background: rgba(108, 99, 255, 0.3);
    color: white;
}
