/**
 * WhatsApp Marketing Tool - Advanced UI Animations
 * Rich animations, gradients, and visual effects
 * Compatible with Bootstrap/Argon - No build required
 */

/* ===== CSS Variables for Gradients ===== */
:root {
    /* Premium Gradients */
    --gradient-royal: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-sunset: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
    --gradient-ocean: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-forest: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-fire: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-cosmic: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #ff6b6b 100%);
    --gradient-aurora: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --gradient-midnight: linear-gradient(135deg, #232526 0%, #414345 100%);
    --gradient-neon: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    --gradient-candy: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);

    /* Shadows */
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-strong: 0 15px 50px rgba(0, 0, 0, 0.15);
    --shadow-glow-primary: 0 0 30px rgba(94, 114, 228, 0.3);
    --shadow-glow-success: 0 0 30px rgba(45, 206, 137, 0.3);
    --shadow-glow-danger: 0 0 30px rgba(245, 54, 92, 0.3);
}

/* ===== Gradient Background Classes ===== */
.bg-gradient-royal {
    background: var(--gradient-royal) !important;
}

.bg-gradient-sunset {
    background: var(--gradient-sunset) !important;
}

.bg-gradient-ocean {
    background: var(--gradient-ocean) !important;
}

.bg-gradient-forest {
    background: var(--gradient-forest) !important;
}

.bg-gradient-fire {
    background: var(--gradient-fire) !important;
}

.bg-gradient-cosmic {
    background: var(--gradient-cosmic) !important;
}

.bg-gradient-aurora {
    background: var(--gradient-aurora) !important;
}

.bg-gradient-midnight {
    background: var(--gradient-midnight) !important;
}

.bg-gradient-neon {
    background: var(--gradient-neon) !important;
}

.bg-gradient-candy {
    background: var(--gradient-candy) !important;
}

/* Animated Gradient */
.bg-gradient-animated {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ===== Enhanced Fade Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@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);
    }
}

/* ===== Scale & Zoom Animations ===== */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomInBounce {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== Bounce & Pulse Animations ===== */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(94, 114, 228, 0.4);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 15px rgba(94, 114, 228, 0);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.1);
    }

    50% {
        transform: scale(1);
    }

    75% {
        transform: scale(1.1);
    }
}

/* ===== Rotate & Flip Animations ===== */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

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

    to {
        transform: rotate(360deg);
    }
}

@keyframes flipIn {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }

    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0);
    }
}

@keyframes swing {

    0%,
    100% {
        transform: rotate(0deg);
    }

    20% {
        transform: rotate(15deg);
    }

    40% {
        transform: rotate(-10deg);
    }

    60% {
        transform: rotate(5deg);
    }

    80% {
        transform: rotate(-5deg);
    }
}

/* ===== Slide Animations ===== */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

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

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

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

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== Shimmer & Glow Effects ===== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(94, 114, 228, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(94, 114, 228, 0.8);
    }
}

@keyframes glowText {

    0%,
    100% {
        text-shadow: 0 0 5px rgba(94, 114, 228, 0.5);
    }

    50% {
        text-shadow: 0 0 20px rgba(94, 114, 228, 0.8);
    }
}

/* ===== Float Animation ===== */
@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(2deg);
    }
}

@keyframes floatSoft {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* ===== Shake Animation ===== */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* ===== 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%,
    100% {
        transform: rotate(0deg);
    }
}

/* ===== Animation Classes ===== */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

.animate-zoom-in {
    animation: zoomIn 0.4s ease-out forwards;
}

.animate-zoom-in-bounce {
    animation: zoomInBounce 0.6s ease-out forwards;
}

.animate-bounce-in {
    animation: bounceIn 0.8s ease-out forwards;
}

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

.animate-pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

.animate-bounce {
    animation: bounce 1.5s ease-in-out infinite;
}

.animate-heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

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

.animate-float-soft {
    animation: floatSoft 3s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-spin-slow {
    animation: spinSlow 3s linear infinite;
}

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

.animate-flip-in {
    animation: flipIn 0.6s ease-out forwards;
}

.animate-wave {
    animation: wave 2s ease-in-out infinite;
}

.animate-slide-in-up {
    animation: slideInUp 0.5s ease-out forwards;
}

.animate-slide-in-down {
    animation: slideInDown 0.5s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.5s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.5s ease-out forwards;
}

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

.animate-glow-text {
    animation: glowText 2s ease-in-out infinite;
}

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

/* Staggered delays */
.animate-delay-100 {
    animation-delay: 0.1s;
    opacity: 0;
}

.animate-delay-200 {
    animation-delay: 0.2s;
    opacity: 0;
}

.animate-delay-300 {
    animation-delay: 0.3s;
    opacity: 0;
}

.animate-delay-400 {
    animation-delay: 0.4s;
    opacity: 0;
}

.animate-delay-500 {
    animation-delay: 0.5s;
    opacity: 0;
}

.animate-delay-600 {
    animation-delay: 0.6s;
    opacity: 0;
}

.animate-delay-700 {
    animation-delay: 0.7s;
    opacity: 0;
}

.animate-delay-800 {
    animation-delay: 0.8s;
    opacity: 0;
}

/* ===== Enhanced Card Effects ===== */
.card-hover {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-strong);
}

.card-hover::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    opacity: 0;
    box-shadow: var(--shadow-medium);
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.card-hover:hover::after {
    opacity: 1;
}

.card-hover-lift {
    transition: all 0.3s ease;
}

.card-hover-lift:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-hover-glow {
    transition: all 0.3s ease;
}

.card-hover-glow:hover {
    box-shadow: var(--shadow-glow-primary);
}

.card-hover-border {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.card-hover-border:hover {
    border-color: #5e72e4;
}

/* Gradient border on hover */
.card-gradient-border {
    position: relative;
    background: white;
    z-index: 1;
}

.card-gradient-border::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-royal);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* ===== Button Effects ===== */
.btn-hover-rise {
    transition: all 0.3s ease;
}

.btn-hover-rise:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-hover-glow {
    transition: all 0.3s ease;
}

.btn-hover-glow:hover {
    box-shadow: 0 0 25px rgba(94, 114, 228, 0.5);
}

.btn-hover-expand {
    transition: all 0.3s ease;
}

.btn-hover-expand:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

.btn-gradient-animated {
    background: linear-gradient(-45deg, #5e72e4, #825ee4, #5e72e4);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    border: none;
}

/* ===== Icon Effects ===== */
.icon-hover-rotate {
    transition: transform 0.3s ease;
}

.icon-hover-rotate:hover i,
.icon-hover-rotate:hover svg {
    transform: rotate(15deg);
}

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

.icon-hover-scale:hover {
    transform: scale(1.2);
}

.icon-hover-bounce:hover i,
.icon-hover-bounce:hover svg {
    animation: bounce 0.5s ease;
}

.icon-gradient {
    background: var(--gradient-royal);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Table Enhancements ===== */
.table-hover-animated tbody tr {
    transition: all 0.25s ease;
}

.table-hover-animated tbody tr:hover {
    background: linear-gradient(90deg, rgba(94, 114, 228, 0.05), rgba(94, 114, 228, 0.1));
    transform: scale(1.01);
}

.table-striped-gradient tbody tr:nth-child(odd) {
    background: linear-gradient(90deg, rgba(94, 114, 228, 0.02), transparent);
}

/* ===== Form Effects ===== */
.form-control-animated {
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
}

.form-control-animated:focus {
    border-color: #5e72e4;
    box-shadow: 0 0 0 4px rgba(94, 114, 228, 0.15);
    transform: translateY(-2px);
}

.form-group-float label {
    transition: all 0.3s ease;
}

/* ===== Badge Effects ===== */
.badge-animated {
    transition: all 0.2s ease;
}

.badge-animated:hover {
    transform: scale(1.15);
}

.badge-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

.badge-gradient {
    background: var(--gradient-royal);
    border: none;
}

/* ===== Progress Bar ===== */
.progress-animated .progress-bar {
    animation: progressFill 1.5s ease-out forwards;
    background: var(--gradient-royal);
}

@keyframes progressFill {
    from {
        width: 0;
    }
}

.progress-striped-animated .progress-bar {
    background-image: linear-gradient(45deg,
            rgba(255, 255, 255, 0.15) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.15) 75%,
            transparent 75%,
            transparent);
    background-size: 1rem 1rem;
    animation: progressStripes 1s linear infinite;
}

@keyframes progressStripes {
    from {
        background-position: 1rem 0;
    }

    to {
        background-position: 0 0;
    }
}

/* ===== Skeleton Loader ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-card {
    height: 200px;
    border-radius: 8px;
}

/* ===== Step Indicator Styles ===== */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.4s ease;
}

.step-indicator.active {
    transform: scale(1.15);
    box-shadow: 0 0 0 5px rgba(94, 114, 228, 0.2);
    animation: pulseGlow 2s ease-in-out infinite;
}

.step-indicator.completed {
    background: var(--gradient-forest);
    animation: bounceIn 0.5s ease-out;
}

/* Step connector line */
.step-connector {
    height: 3px;
    flex-grow: 1;
    background: #e9ecef;
    position: relative;
    overflow: hidden;
}

.step-connector.active::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--gradient-royal);
    animation: progressFill 0.5s ease-out forwards;
}

/* ===== Notification/Toast Effects ===== */
.toast-slide-in {
    animation: slideInRight 0.4s ease-out forwards;
}

.toast-slide-out {
    animation: slideInRight 0.4s ease-out reverse forwards;
}

/* ===== Chat Animations ===== */
.chat-message-in {
    animation: fadeInLeft 0.4s ease-out;
}

.chat-message-out {
    animation: fadeInRight 0.4s ease-out;
}

.chat-bubble {
    position: relative;
}

.chat-bubble::before {
    content: "";
    position: absolute;
    bottom: 0;
    width: 0;
    height: 0;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 12px 18px;
    background: #f1f3f4;
    border-radius: 20px;
    width: fit-content;
}

.typing-indicator span {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #5e72e4, #825ee4);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-10px);
    }
}

/* ===== Empty State Animation ===== */
.empty-state-icon {
    animation: float 4s ease-in-out infinite;
}

.empty-state-icon::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 10px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.1) 0%, transparent 70%);
    animation: shadowPulse 4s ease-in-out infinite;
}

@keyframes shadowPulse {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translateX(-50%) scale(0.8);
        opacity: 0.3;
    }
}

/* ===== Success/Error States ===== */
@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes successCheck {
    0% {
        stroke-dashoffset: 100;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

.animate-success {
    animation: successPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

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

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

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

/* ===== Glassmorphism ===== */
.glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== Gradient Text ===== */
.text-gradient {
    background: var(--gradient-royal);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-sunset {
    background: var(--gradient-sunset);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-ocean {
    background: var(--gradient-ocean);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Hover Underline Effect ===== */
.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-royal);
    transition: width 0.3s ease;
}

.hover-underline:hover::after {
    width: 100%;
}

/* ===== Page Transitions ===== */
.page-enter {
    animation: fadeInUp 0.5s ease-out;
}

.page-exit {
    animation: fadeInUp 0.5s ease-out reverse;
}

/* ===== Number Counter Animation ===== */
.count-up {
    animation: countUp 2s ease-out forwards;
}

/* ===== Confetti (for celebrations) ===== */
@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti-piece {
    position: fixed;
    top: -20px;
    animation: confetti 3s ease-out forwards;
}

/* ===== Reduced Motion Support ===== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Dark Mode Ready ===== */
@media (prefers-color-scheme: dark) {
    .card-hover:hover {
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    }
}