/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

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

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-30px);
    }
    70% {
        transform: translateY(-15px);
    }
    90% {
        transform: translateY(-4px);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(41, 98, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(41, 98, 255, 0.6);
    }
}

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

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

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

/* Animation Classes */
.animate-fade-up {
    animation: fadeInUp 1.5s ease-out forwards;
    opacity: 0;
}

.animate-fade-down {
    animation: fadeInDown 1.5s ease-out forwards;
    opacity: 0;
}

.animate-fade-left {
    animation: fadeInLeft 1.5s ease-out forwards;
    opacity: 0;
}

.animate-fade-right {
    animation: fadeInRight 1.5s ease-out forwards;
    opacity: 0;
}

.animate-slide-up {
    animation: slideUp 1.5s ease-out forwards;
    opacity: 0;
}

.animate-slide-down {
    animation: slideDown 1.5s ease-out forwards;
    opacity: 0;
}

.animate-scale-in {
    animation: scaleIn 1.2s ease-out forwards;
    opacity: 0;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 4s ease-in-out infinite;
}

.animate-rotate {
    animation: rotate 4s linear infinite;
}

.animate-bounce {
    animation: bounce 3s infinite;
}

.animate-shake {
    animation: shake 1s ease-in-out;
}

.animate-glow {
    animation: glow 4s ease-in-out infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}

/* Animation Delays */
.delay-1 {
    animation-delay: 0.5s;
}

.delay-2 {
    animation-delay: 1s;
}

.delay-3 {
    animation-delay: 1.5s;
}

.delay-4 {
    animation-delay: 2s;
}

.delay-5 {
    animation-delay: 2.5s;
}

/* Hover Animations */
.hover-lift {
    transition: transform 0.6s ease, box-shadow 0.6s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.hover-scale {
    transition: transform 0.6s ease;
}

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

.hover-rotate {
    transition: transform 0.6s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-glow {
    transition: box-shadow 0.6s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(41, 98, 255, 0.5);
}

/* Tilt Effect */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* Scroll Animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1.5s ease;
}

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

/* Loading Animations */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.loading-dots {
    display: flex;
    gap: 5px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--secondary-color);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

/* Text Animations */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--secondary-color);
    white-space: nowrap;
    animation: typewriter 6s steps(40, end), blink 1.5s step-end infinite;
}

.gradient-text-animated {
    background: linear-gradient(
        45deg,
        #2962ff,
        #1a237e,
        #00bcd4,
        #2962ff
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite;
}

/* Particle Animation */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 50%;
    opacity: 0.7;
    animation: float 12s ease-in-out infinite;
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 12s;
}

.particle:nth-child(2) {
    left: 20%;
    animation-delay: 2s;
    animation-duration: 16s;
}

.particle:nth-child(3) {
    left: 30%;
    animation-delay: 4s;
    animation-duration: 14s;
}

.particle:nth-child(4) {
    left: 40%;
    animation-delay: 6s;
    animation-duration: 18s;
}

.particle:nth-child(5) {
    left: 50%;
    animation-delay: 8s;
    animation-duration: 12s;
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Stagger Animation */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1.2s ease forwards;
}

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

/* Professional Counter Animations */
@keyframes counterPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes counterGlow {
    0% {
        text-shadow: 0 0 10px rgba(41, 98, 255, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(41, 98, 255, 0.6), 0 0 30px rgba(41, 98, 255, 0.4);
    }
    100% {
        text-shadow: 0 0 10px rgba(41, 98, 255, 0.3);
    }
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(-5deg);
    }
    75% {
        transform: translateY(-5px) rotate(5deg);
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(41, 98, 255, 0.3));
    }
    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 20px rgba(41, 98, 255, 0.6));
    }
}

@keyframes statCardEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    60% {
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.stat-number {
    display: block !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.stat-card:hover .stat-number {
    color: #2962ff !important;
    text-shadow: 0 0 20px rgba(41, 98, 255, 0.8);
}

.stat-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 15px 40px rgba(41, 98, 255, 0.3);
}

.stat-card:hover .stat-number {
    animation: counterGlow 1.5s ease-in-out infinite;
}

.stat-card:hover .stat-icon {
    animation: iconPulse 1s ease-in-out infinite;
}

.stat-icon {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add entrance animation for stat cards */
.stat-card.in-view {
    animation: statCardEntrance 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Responsive Animations */
@media (max-width: 768px) {
    .animate-fade-up,
    .animate-slide-up {
        animation-duration: 0.6s;
    }
    
    .tilt-card:hover {
        transform: none;
    }
    
    .hover-lift:hover {
        transform: translateY(-2px);
    }
    
    .stat-card:hover {
        transform: translateY(-5px) scale(1.02);
    }
    
    @keyframes iconPulse {
        0%, 100% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.1);
        }
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-float,
    .animate-pulse,
    .animate-rotate,
    .animate-bounce {
        animation: none;
    }
}
/* Enhanced Typewriter/Trip Rider Effects */

/* Basic Typewriter Effect */
.typewriter-effect {
    overflow: hidden;
    border-right: 3px solid var(--secondary-color);
    white-space: nowrap;
    animation: typing 6s steps(40, end), blink-caret 1.5s step-end infinite;
}

.typewriter-effect.no-cursor {
    border-right: none;
}

/* Multi-line Typewriter */
.typewriter-multiline {
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    animation: typing-expand 8s steps(60, end) forwards;
}

/* Trip Rider Effect - Multiple Text Rotation */
.trip-rider {
    position: relative;
    display: inline-block;
    min-height: 1.2em;
}

.trip-rider-text {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    transform: translateY(20px);
    animation: tripRiderCycle 16s infinite;
}

.trip-rider-text:nth-child(1) { animation-delay: 0s; }
.trip-rider-text:nth-child(2) { animation-delay: 4s; }
.trip-rider-text:nth-child(3) { animation-delay: 8s; }
.trip-rider-text:nth-child(4) { animation-delay: 12s; }

@keyframes tripRiderCycle {
    0%, 20% {
        opacity: 0;
        transform: translateY(20px);
    }
    25%, 75% {
        opacity: 1;
        transform: translateY(0);
    }
    80%, 100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Advanced Trip Rider with Typing Effect */
.trip-rider-typing {
    position: relative;
    display: inline-block;
    min-height: 1.2em;
}

.trip-rider-typing::after {
    content: '|';
    position: absolute;
    right: -5px;
    top: 0;
    color: var(--secondary-color);
    animation: blink 2s infinite;
}

.trip-rider-word {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    white-space: nowrap;
    overflow: hidden;
    width: 0;
}

.trip-rider-word.active {
    opacity: 1;
    animation: typeAndErase 8s ease-in-out;
}

@keyframes typeAndErase {
    0% {
        width: 0;
    }
    50% {
        width: 100%;
    }
    100% {
        width: 0;
    }
}

/* Glitch Trip Rider Effect */
.trip-rider-glitch {
    position: relative;
    display: inline-block;
    color: var(--text-primary);
}

.trip-rider-glitch::before,
.trip-rider-glitch::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.trip-rider-glitch::before {
    color: #ff0000;
    animation: glitch1 2s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.trip-rider-glitch::after {
    color: #00ffff;
    animation: glitch2 2s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitch1 {
    0%, 14%, 15%, 49%, 50%, 99%, 100% {
        opacity: 0;
        transform: translateX(0);
    }
    15%, 49% {
        opacity: 1;
        transform: translateX(-2px);
    }
}

@keyframes glitch2 {
    0%, 19%, 20%, 44%, 45%, 99%, 100% {
        opacity: 0;
        transform: translateX(0);
    }
    20%, 44% {
        opacity: 1;
        transform: translateX(2px);
    }
}

/* Wave Text Effect */
.wave-text {
    display: inline-block;
}

.wave-text .letter {
    display: inline-block;
    animation: wave 2s ease-in-out infinite;
}

.wave-text .letter:nth-child(1) { animation-delay: 0.1s; }
.wave-text .letter:nth-child(2) { animation-delay: 0.2s; }
.wave-text .letter:nth-child(3) { animation-delay: 0.3s; }
.wave-text .letter:nth-child(4) { animation-delay: 0.4s; }
.wave-text .letter:nth-child(5) { animation-delay: 0.5s; }
.wave-text .letter:nth-child(6) { animation-delay: 0.6s; }
.wave-text .letter:nth-child(7) { animation-delay: 0.7s; }
.wave-text .letter:nth-child(8) { animation-delay: 0.8s; }
.wave-text .letter:nth-child(9) { animation-delay: 0.9s; }
.wave-text .letter:nth-child(10) { animation-delay: 1.0s; }

@keyframes wave {
    0%, 40%, 100% {
        transform: translateY(0);
    }
    20% {
        transform: translateY(-10px);
    }
}

/* Matrix Rain Effect */
.matrix-rain {
    position: relative;
    overflow: hidden;
}

.matrix-rain::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 200%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        var(--secondary-color) 50%,
        transparent 100%
    );
    opacity: 0.1;
    animation: matrixRain 3s linear infinite;
}

@keyframes matrixRain {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

/* Neon Glow Text */
.neon-text {
    color: var(--text-primary);
    text-shadow: 
        0 0 5px var(--secondary-color),
        0 0 10px var(--secondary-color),
        0 0 15px var(--secondary-color),
        0 0 20px var(--secondary-color);
    animation: neonFlicker 2s ease-in-out infinite alternate;
}

@keyframes neonFlicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow: 
            0 0 5px var(--secondary-color),
            0 0 10px var(--secondary-color),
            0 0 15px var(--secondary-color),
            0 0 20px var(--secondary-color);
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* Scramble Text Effect */
.scramble-text {
    position: relative;
    display: inline-block;
}

.scramble-text::before {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    color: var(--secondary-color);
    opacity: 0;
    animation: scramble 3s ease-in-out infinite;
}

@keyframes scramble {
    0%, 80% {
        opacity: 0;
    }
    85%, 95% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Hologram Effect */
.hologram-text {
    position: relative;
    color: var(--text-primary);
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    background-size: 200% 200%;
    animation: hologramScan 3s linear infinite;
}

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

/* Cyberpunk Text Effect */
.cyberpunk-text {
    position: relative;
    color: var(--secondary-color);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cyberpunk-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--secondary-color) 50%,
        transparent 100%
    );
    opacity: 0;
    animation: cyberpunkSweep 2s ease-in-out infinite;
}

@keyframes cyberpunkSweep {
    0%, 100% {
        opacity: 0;
        transform: translateX(-100%);
    }
    50% {
        opacity: 0.3;
        transform: translateX(100%);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .trip-rider,
    .trip-rider-typing {
        min-height: 1em;
        font-size: 0.9em;
    }
    
    .typewriter-effect {
        border-right-width: 2px;
    }
    
    .wave-text .letter {
        animation-duration: 1.5s;
    }
}

@media (prefers-reduced-motion: reduce) {
    .typewriter-effect,
    .trip-rider-text,
    .trip-rider-word,
    .wave-text .letter,
    .neon-text,
    .scramble-text::before,
    .hologram-text,
    .cyberpunk-text::before {
        animation: none;
    }
    
    .trip-rider-text {
        position: static;
        opacity: 1;
        transform: none;
    }
    
    .trip-rider-text:not(:first-child) {
        display: none;
    }
}
/* Download Notification Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Enhanced CGPA Progress Animations */
@keyframes progressGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(41, 98, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(41, 98, 255, 0.6);
    }
}

.progress-fill {
    animation: progressGlow 2s ease-in-out infinite;
}

/* Counter Pulse Animation */
@keyframes counterPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.cgpa-counter, .sgpa-counter {
    animation: counterPulse 2s ease-in-out infinite;
}

/* Stat Box Hover Animation */
@keyframes statBoxFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.animated-stat:hover {
    animation: statBoxFloat 1s ease-in-out infinite;
}