/* ===============================================
   CUSTOM ANIMATIONS FOR AQ LEARNING PLATFORM
   =============================================== */

/* Fade In Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    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 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);
    }
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleInCenter {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce Animations */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceInLeft {
    0% {
        opacity: 0;
        transform: translateX(-2000px);
    }
    60% {
        opacity: 1;
        transform: translateX(30px);
    }
    80% {
        transform: translateX(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounceInRight {
    0% {
        opacity: 0;
        transform: translateX(2000px);
    }
    60% {
        opacity: 1;
        transform: translateX(-30px);
    }
    80% {
        transform: translateX(10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide Animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Rotate Animations */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg);
    }
    to {
        opacity: 1;
        transform: rotate(0deg);
    }
}

@keyframes rotateInDownLeft {
    from {
        opacity: 0;
        transform: rotate(-45deg) translateX(-100px);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) translateX(0);
    }
}

@keyframes rotateInDownRight {
    from {
        opacity: 0;
        transform: rotate(45deg) translateX(100px);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) translateX(0);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* Wobble Animation */
@keyframes wobble {
    0% {
        transform: translateX(0%);
    }
    15% {
        transform: translateX(-25%) rotate(-5deg);
    }
    30% {
        transform: translateX(20%) rotate(3deg);
    }
    45% {
        transform: translateX(-15%) rotate(-3deg);
    }
    60% {
        transform: translateX(10%) rotate(2deg);
    }
    75% {
        transform: translateX(-5%) rotate(-1deg);
    }
    100% {
        transform: translateX(0%);
    }
}

/* Zoom Animations */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomInLeft {
    from {
        opacity: 0;
        transform: scale(0.1) translateX(-1000px);
    }
    60% {
        opacity: 1;
        transform: scale(0.475) translateX(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

@keyframes zoomInRight {
    from {
        opacity: 0;
        transform: scale(0.1) translateX(1000px);
    }
    60% {
        opacity: 1;
        transform: scale(0.475) translateX(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

/* Flip Animations */
@keyframes flipInX {
    from {
        transform: perspective(400px) rotateX(90deg);
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotateX(-20deg);
    }
    60% {
        transform: perspective(400px) rotateX(10deg);
        opacity: 1;
    }
    80% {
        transform: perspective(400px) rotateX(-5deg);
    }
    to {
        transform: perspective(400px) rotateX(0deg);
        opacity: 1;
    }
}

@keyframes flipInY {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotateY(-20deg);
    }
    60% {
        transform: perspective(400px) rotateY(10deg);
        opacity: 1;
    }
    80% {
        transform: perspective(400px) rotateY(-5deg);
    }
    to {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
    }
}

/* Light Speed Animations */
@keyframes lightSpeedIn {
    from {
        transform: translateX(100%) skewX(-30deg);
        opacity: 0;
    }
    60% {
        transform: translateX(-20%) skewX(30deg);
        opacity: 1;
    }
    80% {
        transform: translateX(0%) skewX(-15deg);
        opacity: 1;
    }
    to {
        transform: translateX(0%) skewX(0deg);
        opacity: 1;
    }
}

/* Roll In Animation */
@keyframes rollIn {
    from {
        opacity: 0;
        transform: translateX(-100%) rotate(-120deg);
    }
    to {
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
}

/* ===============================================
   ANIMATION CLASSES
   =============================================== */

.animate-fadeIn {
    animation: fadeIn 0.8s ease-out;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.8s ease-out;
}

.animate-fadeInRight {
    animation: fadeInRight 0.8s ease-out;
}

.animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fadeInDown {
    animation: fadeInDown 0.8s ease-out;
}

.animate-scaleIn {
    animation: scaleIn 0.6s ease-out;
}

.animate-scaleInCenter {
    animation: scaleInCenter 0.6s ease-out;
}

.animate-bounceIn {
    animation: bounceIn 1s ease-out;
}

.animate-bounceInLeft {
    animation: bounceInLeft 1s ease-out;
}

.animate-bounceInRight {
    animation: bounceInRight 1s ease-out;
}

.animate-slideInLeft {
    animation: slideInLeft 0.8s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 0.8s ease-out;
}

.animate-slideInUp {
    animation: slideInUp 0.8s ease-out;
}

.animate-slideInDown {
    animation: slideInDown 0.8s ease-out;
}

.animate-rotateIn {
    animation: rotateIn 0.8s ease-out;
}

.animate-rotateInDownLeft {
    animation: rotateInDownLeft 0.8s ease-out;
}

.animate-rotateInDownRight {
    animation: rotateInDownRight 0.8s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-wobble {
    animation: wobble 1s ease-in-out;
}

.animate-zoomIn {
    animation: zoomIn 0.6s ease-out;
}

.animate-zoomInLeft {
    animation: zoomInLeft 0.6s ease-out;
}

.animate-zoomInRight {
    animation: zoomInRight 0.6s ease-out;
}

.animate-flipInX {
    animation: flipInX 0.8s ease-out;
}

.animate-flipInY {
    animation: flipInY 0.8s ease-out;
}

.animate-lightSpeedIn {
    animation: lightSpeedIn 0.8s ease-out;
}

.animate-rollIn {
    animation: rollIn 0.8s ease-out;
}

/* ===============================================
   HOVER EFFECTS
   =============================================== */

.hover-scale:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
    transition: transform 0.3s ease;
}

.hover-bounce:hover {
    animation: bounceIn 0.6s ease;
}

.hover-pulse:hover {
    animation: pulse 1s infinite;
}

.hover-shake:hover {
    animation: shake 0.5s ease-in-out;
}

.hover-wobble:hover {
    animation: wobble 1s ease-in-out;
}

/* ===============================================
   DELAYED ANIMATIONS
   =============================================== */

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

.delay-6 {
    animation-delay: 0.6s;
}

.delay-7 {
    animation-delay: 0.7s;
}

.delay-8 {
    animation-delay: 0.8s;
}

.delay-9 {
    animation-delay: 0.9s;
}

.delay-10 {
    animation-delay: 1s;
}

/* ===============================================
   RESPONSIVE ANIMATIONS
   =============================================== */

@media (max-width: 768px) {
    .animate-fadeInLeft,
    .animate-fadeInRight,
    .animate-bounceInLeft,
    .animate-bounceInRight,
    .animate-slideInLeft,
    .animate-slideInRight,
    .animate-rotateInDownLeft,
    .animate-rotateInDownRight,
    .animate-zoomInLeft,
    .animate-zoomInRight {
        animation: fadeInUp 0.8s ease-out;
    }
}

/* ===============================================
   LOADING ANIMATIONS
   =============================================== */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes dots {
    0%, 20% {
        color: rgba(0,0,0,0);
        text-shadow:
            .25em 0 0 rgba(0,0,0,0),
            .5em 0 0 rgba(0,0,0,0);
    }
    40% {
        color: black;
        text-shadow:
            .25em 0 0 rgba(0,0,0,0),
            .5em 0 0 rgba(0,0,0,0);
    }
    60% {
        text-shadow:
            .25em 0 0 black,
            .5em 0 0 rgba(0,0,0,0);
    }
    80%, 100% {
        text-shadow:
            .25em 0 0 black,
            .5em 0 0 black;
    }
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}

/* ===============================================
   SPECIAL EFFECTS
   =============================================== */

.glow {
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.5);
    transition: box-shadow 0.3s ease;
}

.glow:hover {
    box-shadow: 0 0 30px rgba(0, 123, 255, 0.8);
}

.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.wiggle {
    animation: wiggle 1s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 7% {
        transform: rotateZ(0);
    }
    15% {
        transform: rotateZ(-15deg);
    }
    20% {
        transform: rotateZ(10deg);
    }
    25% {
        transform: rotateZ(-10deg);
    }
    30% {
        transform: rotateZ(6deg);
    }
    35% {
        transform: rotateZ(-4deg);
    }
    40%, 100% {
        transform: rotateZ(0);
    }
}


