/* 
 * Animations Stylesheet for Dr. Sharma's Academy Website
 * Author: AI Assistant
 * Version: 1.0
 */

/* ===== TYPING ANIMATION ===== */
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--secondary-color) }
}

.typing-animation {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--secondary-color);
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

/* ===== FADE ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

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

/* ===== COUNTER ANIMATION ===== */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== PULSE ANIMATION ===== */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* ===== FLOAT ANIMATION ===== */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

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

/* ===== ROTATE ANIMATION ===== */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== SCALE ANIMATION ===== */
@keyframes scale {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ===== LOADING ANIMATIONS ===== */
@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

.skeleton {
    background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
    background-size: 800px 104px;
    animation: shimmer 1.5s infinite linear;
}

/* ===== SCROLL ANIMATIONS ===== */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.fade-in {
    opacity: 0;
}

.animate-on-scroll.fade-in.animated {
    opacity: 1;
}

.animate-on-scroll.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
}

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

.animate-on-scroll.fade-in-down {
    opacity: 0;
    transform: translateY(-30px);
}

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

.animate-on-scroll.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
}

.animate-on-scroll.fade-in-left.animated {
    opacity: 1;
    transform: translateX(0);
}

.animate-on-scroll.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
}

.animate-on-scroll.fade-in-right.animated {
    opacity: 1;
    transform: translateX(0);
}

.animate-on-scroll.zoom-in {
    opacity: 0;
    transform: scale(0.9);
}

.animate-on-scroll.zoom-in.animated {
    opacity: 1;
    transform: scale(1);
}

/* Animation delays */
.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

.delay-400 {
    transition-delay: 0.4s;
}

.delay-500 {
    transition-delay: 0.5s;
}

.delay-600 {
    transition-delay: 0.6s;
}

.delay-700 {
    transition-delay: 0.7s;
}

.delay-800 {
    transition-delay: 0.8s;
}

.delay-900 {
    transition-delay: 0.9s;
}

.delay-1000 {
    transition-delay: 1s;
}

/* ===== HOVER ANIMATIONS ===== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

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

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

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

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

.hover-glow:hover {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}

/* ===== BUTTON ANIMATIONS ===== */
.btn-pulse {
    animation: pulse 2s infinite;
}

.btn-float {
    animation: float 3s ease-in-out infinite;
}

/* ===== LOADING SPINNER ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(30, 64, 175, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: rotate 1s linear infinite;
}

/* ===== PROGRESS BAR ANIMATION ===== */
@keyframes progressBar {
    0% { width: 0; }
    100% { width: 100%; }
}

.progress-bar {
    height: 4px;
    background-color: var(--secondary-color);
    width: 0;
    animation: progressBar 3s ease-in-out forwards;
}

/* ===== CARD FLIP ANIMATION ===== */
.card-flip {
    perspective: 1000px;
}

.card-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-flip:hover .card-flip-inner {
    transform: rotateY(180deg);
}

.card-flip-front, .card-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.card-flip-back {
    transform: rotateY(180deg);
}

/* ===== RIPPLE EFFECT ===== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.ripple:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* ===== STAGGERED ANIMATIONS ===== */
.stagger-item {
    opacity: 0;
}

.stagger-item.animated {
    animation: fadeInUp 0.5s ease forwards;
}

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

/* ===== BACKGROUND GRADIENT ANIMATION ===== */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background: linear-gradient(-45deg, #1e40af, #3b82f6, #0f2167, #1e3a8a);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

/* ===== SHAKE ANIMATION FOR NOTIFICATIONS ===== */
.notification-shake {
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
}

/* ===== COUNTER ANIMATION ===== */
.counter-animation {
    display: inline-block;
    animation: countUp 2s ease-out forwards;
}

/* ===== TYPING CURSOR ANIMATION ===== */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background-color: var(--secondary-color);
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}

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

/* ===== SCROLL INDICATOR ANIMATION ===== */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border: 2px solid var(--white);
    border-radius: 15px;
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    background-color: var(--white);
    border-radius: 50%;
    animation: scrollDown 2s infinite;
}

@keyframes scrollDown {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    80% {
        transform: translateY(20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 0;
    }
}

/* ===== GLASSMORPHISM HOVER EFFECT ===== */
.glassmorphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.glassmorphism:hover {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ===== NEUMORPHISM EFFECT ===== */
.neumorphism {
    background: var(--off-white);
    border-radius: 10px;
    box-shadow: 
        5px 5px 10px rgba(0, 0, 0, 0.1),
        -5px -5px 10px rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.neumorphism:hover {
    box-shadow: 
        inset 5px 5px 10px rgba(0, 0, 0, 0.1),
        inset -5px -5px 10px rgba(255, 255, 255, 0.8);
}

/* ===== REVEAL TEXT ANIMATION ===== */
.reveal-text {
    position: relative;
    color: transparent;
}

.reveal-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    color: var(--primary-color);
    overflow: hidden;
    width: 0;
    animation: revealText 2s forwards 0.5s;
}

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

/* ===== LOADING DOTS ANIMATION ===== */
.loading-dots::after {
    content: '.';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60% { content: '...'; }
    80%, 100% { content: ''; }
}

/* ===== SLIDE IN ANIMATION ===== */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.5s forwards;
}

/* ===== SLIDE OUT ANIMATION ===== */
@keyframes slideOut {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

.slide-out {
    animation: slideOut 0.5s forwards;
}

/* ===== BOUNCE ANIMATION ===== */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 2s infinite;
}

/* ===== HEARTBEAT ANIMATION ===== */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.1);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(1);
    }
}

.heartbeat {
    animation: heartbeat 2s infinite;
}

/* ===== WAVE ANIMATION ===== */
@keyframes wave {
    0% {
        transform: rotate(0deg);
    }
    10% {
        transform: rotate(14deg);
    }
    20% {
        transform: rotate(-8deg);
    }
    30% {
        transform: rotate(14deg);
    }
    40% {
        transform: rotate(-4deg);
    }
    50% {
        transform: rotate(10deg);
    }
    60% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

.wave {
    animation: wave 2.5s infinite;
    transform-origin: 70% 70%;
    display: inline-block;
}