/**
 * AniTime Animation Styles
 * Premium micro-animations and transitions
 */

/* ===== BASE TRANSITIONS ===== */
.at-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.at-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.at-stagger>* {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.at-stagger.visible>*:nth-child(1) {
    transition-delay: 0.05s;
}

.at-stagger.visible>*:nth-child(2) {
    transition-delay: 0.1s;
}

.at-stagger.visible>*:nth-child(3) {
    transition-delay: 0.15s;
}

.at-stagger.visible>*:nth-child(4) {
    transition-delay: 0.2s;
}

.at-stagger.visible>*:nth-child(5) {
    transition-delay: 0.25s;
}

.at-stagger.visible>*:nth-child(6) {
    transition-delay: 0.3s;
}

.at-stagger.visible>*:nth-child(7) {
    transition-delay: 0.35s;
}

.at-stagger.visible>*:nth-child(8) {
    transition-delay: 0.4s;
}

.at-stagger.visible>* {
    opacity: 1;
    transform: translateY(0);
}

/* ===== HOVER EFFECTS ===== */
.at-card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.at-card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Image Zoom on Hover */
.at-img-zoom {
    overflow: hidden;
}

.at-img-zoom img,
.at-img-zoom .at-poster-wrapper {
    transition: transform 0.5s ease;
}

.at-img-zoom:hover img,
.at-img-zoom:hover .at-poster-wrapper {
    transform: scale(1.08);
}

/* ===== KEYFRAME ANIMATIONS ===== */
@keyframes at-fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes at-slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes at-slideLeft {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes at-scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes at-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes at-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes at-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes at-glow {

    0%,
    100% {
        box-shadow: 0 0 5px var(--at-primary);
    }

    50% {
        box-shadow: 0 0 20px var(--at-primary), 0 0 30px var(--at-primary);
    }
}

/* Apply Classes */
.at-anim-fadeIn {
    animation: at-fadeIn 0.6s ease-out forwards;
}

.at-anim-slideUp {
    animation: at-slideUp 0.6s ease-out forwards;
}

.at-anim-scaleIn {
    animation: at-scaleIn 0.5s ease-out forwards;
}

.at-anim-pulse {
    animation: at-pulse 2s ease-in-out infinite;
}

.at-anim-float {
    animation: at-float 3s ease-in-out infinite;
}

.at-anim-glow {
    animation: at-glow 2s ease-in-out infinite;
}

/* Skeleton Loading */
.at-skeleton {
    background: linear-gradient(90deg, var(--at-border) 25%, var(--at-surface) 50%, var(--at-border) 75%);
    background-size: 200% 100%;
    animation: at-shimmer 1.5s infinite;
    border-radius: 4px;
}

/* ===== PAGE TRANSITIONS ===== */
.at-hero {
    animation: at-fadeIn 0.8s ease-out;
}

.at-hero .at-poster {
    animation: at-slideUp 0.7s ease-out 0.2s both;
}

.at-hero .at-info {
    animation: at-slideUp 0.7s ease-out 0.4s both;
}

/* ===== BUTTON EFFECTS ===== */
.at-btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.at-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.at-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.at-btn:active::after {
    width: 300px;
    height: 300px;
}

/* ===== SCROLL PROGRESS BAR ===== */
.at-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--at-primary), #f59e0b);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s linear;
}

/* ===== TEXT EFFECTS ===== */
.at-text-gradient {
    background: linear-gradient(135deg, var(--at-primary), #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== RIPPLE EFFECT ===== */
.at-ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: at-ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes at-ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== TOAST NOTIFICATIONS ===== */
.at-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.at-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: var(--at-bg-card);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.at-toast.show {
    transform: translateX(0);
}

.at-toast-icon {
    font-size: 1.2rem;
}

.at-toast-success .at-toast-icon {
    color: #10b981;
}

.at-toast-error .at-toast-icon {
    color: #ef4444;
}

.at-toast-warning .at-toast-icon {
    color: #f59e0b;
}

.at-toast-info .at-toast-icon {
    color: #3b82f6;
}

/* ===== MODAL ===== */
.at-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.at-modal-overlay.active {
    opacity: 1;
}

.at-modal {
    background: var(--at-bg-card);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.at-modal-overlay.active .at-modal {
    transform: scale(1);
}

.at-modal.large {
    max-width: 900px;
}

.at-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--at-surface);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    color: inherit;
}

.at-modal-content {
    padding: 30px;
}

/* ===== CONFETTI ===== */
.at-confetti {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    z-index: 99999;
    animation: at-confetti-fall 3s ease-out forwards;
}

@keyframes at-confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===== LOADING STATES ===== */
.at-loading {
    position: relative;
    pointer-events: none;
}

.at-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.at-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--at-surface);
    border-top-color: var(--at-primary);
    border-radius: 50%;
    animation: at-spin 0.8s linear infinite;
}

@keyframes at-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== TILT CARD ===== */
.at-card-tilt {
    transition: transform 0.1s ease;
    transform-style: preserve-3d;
}