/**
 * animations.css - XTN 2026 Animations
 * Lấy cảm hứng từ UEL Day 2025
 */

/* ===== KEYFRAMES ===== */

/* Pulse Gold - Cho floating button */
@keyframes pulse-gold {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.6);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(255, 215, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* Pulse Green */
@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(22, 163, 74, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
    }
}

/* Pulse Red - Cho hotspots */
@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(220, 38, 38, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

/* Hotspot Pulse - Cho map markers */
@keyframes hotspot-pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Float Animation */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Shine Effect - Cho buttons */
@keyframes shine {
    0% {
        left: -100%;
    }

    100% {
        left: 120%;
    }
}

/* Spin - Loading */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Bounce */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* ===== UTILITY CLASSES ===== */

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-pulse-gold {
    animation: pulse-gold 2s infinite;
}

.animate-pulse-green {
    animation: pulse-green 2s infinite;
}

.animate-pulse-red {
    animation: pulse-red 2s infinite;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease-out;
}

/* ===== FLOATING SUPPORT BUTTON ===== */
.support-pin {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
    z-index: 999;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    animation: pulse-gold 2s infinite;
}

.support-pin:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
}

.support-pin svg,
.support-pin i {
    width: 28px;
    height: 28px;
    color: #1f2937;
    font-size: 1.5rem;
}

.support-tooltip {
    position: absolute;
    bottom: 110%;
    right: 0;
    padding: 15px 20px;
    background: var(--secondary);
    color: #fff;
    border-radius: 12px;
    white-space: nowrap;
    font-size: 0.9rem;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(22, 163, 74, 0.3);
    text-align: left;
}

.support-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    border: 8px solid transparent;
    border-top-color: var(--secondary);
}

.support-tooltip strong {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
}

.support-tooltip .contact-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 0.85rem;
}

.support-tooltip .contact-line:last-child {
    margin-bottom: 0;
}

.support-tooltip .contact-line i {
    width: 16px;
    color: var(--primary);
}

.support-pin:hover .support-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* ===== BUTTON SHINE EFFECT ===== */
.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 75%;
    height: 100%;
    background: linear-gradient(120deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.4) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: left 0.75s ease;
}

.btn-shine:hover::before {
    left: 120%;
}

/* ===== STICKY HEADER ===== */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.sticky-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(255, 215, 0, 0.15);
}

/* ===== MAP HOTSPOTS ===== */
.map-wrapper {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.map-wrapper .map-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 20px;
}

.hotspot {
    position: absolute;
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 50%;
    border: 3px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
    z-index: 5;
    transition: transform 0.3s ease;
}

.hotspot:hover {
    transform: scale(1.2);
}

.hotspot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent);
    animation: hotspot-pulse 1.5s infinite;
    z-index: -1;
}

/* Hotspot đặc biệt cho UEL - màu vàng */
.hotspot.hotspot-main {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    font-size: 16px;
}

.hotspot.hotspot-main::after {
    background: var(--primary);
}

/* Tooltip cho hotspot */
.hotspot .tooltip {
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary);
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 0.9rem;
    min-width: 180px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(22, 163, 74, 0.3);
}

.hotspot .tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border: 8px solid transparent;
    border-top-color: var(--secondary);
}

.hotspot .tooltip strong {
    display: block;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--primary);
}

.hotspot:hover .tooltip {
    opacity: 1;
    visibility: visible;
    bottom: 140%;
}

/* Tooltip alignment adjustments */
.hotspot .tooltip.align-left {
    left: 0;
    transform: translateX(0);
}

.hotspot .tooltip.align-left::after {
    left: 16px;
}

.hotspot .tooltip.align-right {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.hotspot .tooltip.align-right::after {
    left: auto;
    right: 16px;
}

/* ===== COUNTER ANIMATION ===== */
.counter-animated {
    transition: transform 0.3s ease;
}

.counter-animated.flash-update {
    animation: scaleIn 0.5s ease-out;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .support-pin {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }

    .support-pin svg,
    .support-pin i {
        width: 24px;
        height: 24px;
        font-size: 1.2rem;
    }

    .support-tooltip {
        display: none;
    }

    .hotspot {
        width: 24px;
        height: 24px;
        font-size: 11px;
        border-width: 2px;
    }

    .hotspot.hotspot-main {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }

    .hotspot .tooltip {
        min-width: 150px;
        font-size: 0.8rem;
        padding: 10px 14px;
    }
}