/* ===== KEYFRAMES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

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

@keyframes float {

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

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

@keyframes floatSlow {

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

    50% {
        transform: translateY(-20px) rotate(3deg);
    }
}

@keyframes pulse {

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

    50% {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

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

@keyframes gradient-shift {

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

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

@keyframes blob-morph {

    0%,
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

@keyframes glow-pulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(108, 99, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(108, 99, 255, 0.6);
    }
}

@keyframes notification-in {
    0% {
        transform: translateX(120%);
        opacity: 0;
    }

    80% {
        transform: translateX(-10px);
        opacity: 1;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse-dot {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}

@keyframes pulse-blink {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
        box-shadow: 0 0 5px #10B981;
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.2);
        box-shadow: 0 0 15px #10B981;
    }
}

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

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

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }

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

@keyframes float-complex {

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

    50% {
        transform: translateY(-15px) rotate(1deg) scale(1.02);
    }
}

@keyframes border-glow-flow {

    0%,
    100% {
        border-image-source: linear-gradient(0deg, var(--primary), var(--accent));
    }

    50% {
        border-image-source: linear-gradient(180deg, var(--accent), var(--cyan));
    }
}

@keyframes text-shimmer {
    0% {
        background-position: -200% center;
    }

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

/* ===== SCROLL-TRIGGERED ANIMATION CLASSES ===== */
.animate {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-left {
    transform: translateX(-30px);
}

.animate-right {
    transform: translateX(30px);
}

.animate-scale {
    transform: scale(0.9);
}

.animate-left.visible,
.animate-right.visible,
.animate-scale.visible {
    opacity: 1;
    transform: none;
}

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

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

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

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

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

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

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

.float-slow {
    animation: floatSlow 5s ease-in-out infinite;
}

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

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

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

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

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

.morph-blob {
    animation: blob-morph 8s ease-in-out infinite;
}

.gradient-animate {
    background: linear-gradient(270deg, var(--primary), var(--cyan), var(--accent), var(--primary));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 6s ease infinite;
}

/* ===== 3D HOVER EFFECTS ===== */
.hover-3d {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    transform-style: preserve-3d;
}

.hover-3d:hover {
    transform: translateY(-8px) scale(1.02) perspective(1000px) rotateX(2deg) rotateY(-2deg);
    box-shadow: var(--shadow-primary);
    border-color: var(--border-hover);
    z-index: 10;
}

.glow-border {
    position: relative;
}

.glow-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--primary), transparent, var(--accent));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.glow-border:hover::before {
    opacity: 1;
    background: linear-gradient(135deg, var(--cyan), var(--primary), var(--accent));
}

.text-shimmer {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.7) 0%, #fff 50%, rgba(255, 255, 255, 0.7) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-shimmer 3s linear infinite;
}

/* ===== SPINNER ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: #1a1f35;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: notification-in 0.4s ease forwards;
    pointer-events: all;
    box-shadow: var(--shadow);
}

.toast-icon {
    font-size: 20px;
}

.toast-content .title {
    font-size: 14px;
    font-weight: 700;
}

.toast-content .msg {
    font-size: 12px;
    color: var(--text-secondary);
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.toast.info {
    border-left: 3px solid var(--info);
}

.toast.warning {
    border-left: 3px solid var(--warning);
}

/* ===== PROGRESS BAR ===== */
.progress-bar-wrap {
    background: var(--bg-input);
    border-radius: var(--radius-pill);
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.lift:hover {
    transform: translateY(-4px);
    transition: var(--transition);
}

.ripple {
    position: relative;
    overflow: hidden;
}


.ripple:active::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-effect 0.4s ease;
    pointer-events: none;
}

/* ===== SMART HOME VIDEO ANIMATION ===== */
@keyframes smart-home-video-feel {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
        filter: drop-shadow(0 0 30px rgba(124, 58, 237, 0.4));
    }

    33% {
        transform: translateY(-15px) rotate(1.5deg) scale(1.02);
        filter: drop-shadow(0 0 50px rgba(124, 58, 237, 0.6));
    }

    66% {
        transform: translateY(-5px) rotate(-1deg) scale(1.01);
        filter: drop-shadow(0 0 40px rgba(124, 58, 237, 0.5));
    }
}

.hero-3d-main {
    animation: smart-home-video-feel 8s ease-in-out infinite !important;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none !important;
    /* Remove the circle border to let the hexagonal platform shine */
    border-radius: 20px !important;
    /* Rounded corners for the image itself */
    box-shadow: none !important;
    /* Managed by filter drop-shadow in keyframes */
}

.hero-3d-main:hover {
    transform: scale(1.05) rotate(3deg) !important;
    filter: drop-shadow(0 0 60px rgba(124, 58, 237, 0.8)) !important;
}

/* ===== URGENT HIGHLIGHTS ===== */
@keyframes urgent-pulse-glow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 71, 87, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 0 25px rgba(255, 71, 87, 0.8), 0 0 10px rgba(255, 71, 87, 0.5); }
}

@keyframes urgent-shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

@keyframes button-shimmer-glow {
    0% { background-position: -200% 0; box-shadow: 0 0 10px rgba(255, 71, 87, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 71, 87, 0.6); }
    100% { background-position: 200% 0; box-shadow: 0 0 10px rgba(255, 71, 87, 0.3); }
}

.pulse-urgent {
    animation: urgent-pulse-glow 1.5s ease-in-out infinite, urgent-shake 0.3s ease-in-out infinite alternate;
    display: inline-block;
    background: #FF4757 !important;
    color: white !important;
    font-weight: 900 !important;
}

.shimmer-urgent {
    background: linear-gradient(90deg, #FF4757, #FF6B81, #FF4757);
    background-size: 200% auto;
    animation: button-shimmer-glow 2s linear infinite;
    border: none !important;
    color: white !important;
    font-weight: 800 !important;
    cursor: pointer;
}

@keyframes slow-float-drift {
    0% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-3px) rotate(0.2deg); }
    66% { transform: translateY(-1px) rotate(-0.2deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

.float-drift {
    animation: slow-float-drift 6s ease-in-out infinite;
}
/* Local & Region Match Animations */
@keyframes pulse-match {
    0%, 100% { transform: scale(1); box-shadow: 0 0 5px rgba(0, 217, 165, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 15px rgba(0, 217, 165, 0.8); }
}

@keyframes match-glow {
    0%, 100% { border-color: rgba(0, 217, 165, 0.3); background: rgba(0, 217, 165, 0.05); }
    50% { border-color: rgba(0, 217, 165, 0.8); background: rgba(0, 217, 165, 0.1); }
}

.animate-pulse-match {
    animation: pulse-match 2s ease-in-out infinite;
    display: inline-block;
}

.match-highlight-card {
    animation: match-glow 3s ease-in-out infinite !important;
    border-width: 2px !important;
}

