/* Data-Espresso Wrapped 2025 - Tailwind Enhancement Styles */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* ============================================
   GSAP Animation Classes
   ============================================ */

/* Text reveal animation */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
}

/* Slide up animation */
.gsap-slide-up {
    opacity: 0;
    transform: translateY(80px);
}

/* Scale in animation */
.gsap-scale-in {
    opacity: 0;
    transform: scale(0.8);
}

/* Fade in animation */
.gsap-fade-in {
    opacity: 0;
}

/* Rotate in animation */
.gsap-rotate-in {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
}

/* Blur in animation */
.gsap-blur-in {
    opacity: 0;
    filter: blur(20px);
}

/* Stagger cards */
.gsap-stagger {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
}

/* ============================================
   Mouse Glow Trail
   ============================================ */

#mouseGlow {
    transition: opacity 0.3s ease;
    will-change: transform, opacity;
}

#mouseGlow.active {
    opacity: 1;
}

/* ============================================
   Enhanced Hover Effects
   ============================================ */

/* Magnetic button effect */
.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Ripple effect on click */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.ripple-effect:active::after {
    transform: translate(-50%, -50%) scale(2);
    opacity: 1;
    transition: transform 0s, opacity 0s;
}

/* Card tilt on hover */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateZ(10px);
}

/* Glow pulse on hover */
.glow-hover {
    transition: box-shadow 0.4s ease, transform 0.3s ease;
}

.glow-hover:hover {
    box-shadow:
        0 0 20px rgba(214, 34, 100, 0.5),
        0 0 40px rgba(214, 34, 100, 0.3),
        0 0 60px rgba(214, 34, 100, 0.1);
}

/* Number counter glow */
.counter-glow {
    text-shadow: 0 0 30px currentColor;
}

/* ============================================
   Confetti Celebration
   ============================================ */

.celebration-trigger {
    position: relative;
}

/* ============================================
   Parallax Effects
   ============================================ */

.parallax-slow {
    will-change: transform;
}

.parallax-fast {
    will-change: transform;
}

/* ============================================
   Loading Animation
   ============================================ */

.page-loader {
    position: fixed;
    inset: 0;
    background: #050505;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    animation: loaderPulse 1.5s ease-in-out infinite;
}

@keyframes loaderPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* ============================================
   Floating Elements
   ============================================ */

.float-random {
    animation: floatRandom 8s ease-in-out infinite;
}

@keyframes floatRandom {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -15px) rotate(5deg); }
    50% { transform: translate(-5px, -25px) rotate(-3deg); }
    75% { transform: translate(-15px, -10px) rotate(3deg); }
}

/* ============================================
   Gradient Text Animation
   ============================================ */

.animated-gradient-text {
    background: linear-gradient(
        90deg,
        #fff 0%,
        #D62264 25%,
        #FF6F3C 50%,
        #D62264 75%,
        #fff 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientText 4s linear infinite;
}

@keyframes gradientText {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ============================================
   Spotlight Effect
   ============================================ */

.spotlight {
    position: relative;
}

.spotlight::before {
    content: '';
    position: absolute;
    inset: -100%;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(214, 34, 100, 0.15) 0%,
        transparent 50%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.spotlight:hover::before {
    opacity: 1;
}

/* Animation Base - Scroll triggered */
.animate-item {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Chart bar styling */
.chart-bar {
    flex: 1;
    min-height: 10px;
    border-radius: 8px 8px 0 0;
    transition: height 0.8s ease, opacity 0.4s ease, box-shadow 0.3s ease;
    opacity: 0;
    cursor: pointer;
    position: relative;
    background: linear-gradient(180deg, #FF6F3C 0%, #D62264 100%);
}

.chart-bar:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 20px rgba(255, 111, 60, 0.5);
}

.chart-bar::after {
    content: attr(data-count);
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
    text-shadow: 0 0 10px rgba(255, 111, 60, 0.8);
}

.chart-bar:hover::after {
    opacity: 1;
}

.chart-bar.animate {
    opacity: 1;
}

/* Topic bar animation */
.topic-bar {
    height: 100%;
    border-radius: 4px;
    width: 0;
    transition: width 1s ease-out;
    background: linear-gradient(90deg, #D62264 0%, #FF6F3C 100%);
    box-shadow: 0 0 10px rgba(214, 34, 100, 0.3);
}

/* Glow text effect */
.glow-text {
    text-shadow: 0 0 20px rgba(214, 34, 100, 0.5), 0 0 40px rgba(255, 111, 60, 0.3);
}

/* Card glow on hover */
.card-glow {
    transition: all 0.3s ease;
}

.card-glow:hover {
    box-shadow: 0 0 30px rgba(214, 34, 100, 0.4), 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Gradient text animation */
.gradient-text-animate {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Neon glow effect */
.neon-glow {
    box-shadow:
        0 0 10px rgba(214, 34, 100, 0.4),
        0 0 20px rgba(214, 34, 100, 0.3),
        0 0 30px rgba(214, 34, 100, 0.2),
        0 0 40px rgba(214, 34, 100, 0.1);
}

/* Pulse animation for badges */
.pulse-badge {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(214, 34, 100, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 111, 60, 0.6);
    }
}

/* Border glow effect */
.border-glow {
    position: relative;
}

.border-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, #D62264, #FF6F3C, #D62264);
    -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;
    transition: opacity 0.3s ease;
}

.border-glow:hover::before {
    opacity: 1;
}

/* Golden glow for #1 */
.golden-glow {
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.3),
        0 0 40px rgba(255, 215, 0, 0.2),
        0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Shimmer effect */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2E0F38;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #D62264, #FF6F3C);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #FF6F3C, #D62264);
}

/* Selection color */
::selection {
    background: rgba(214, 34, 100, 0.5);
    color: white;
}

/* ============================================
   Tag Cloud / Keywords Section
   ============================================ */

/* 3D Sphere Container */
.tag-sphere-container {
    width: 320px;
    height: 320px;
    position: relative;
}

@media (min-width: 768px) {
    .tag-sphere-container {
        width: 450px;
        height: 450px;
    }
}

/* TagCloud.js generated elements */
.tagcloud {
    font-family: 'Space Grotesk', 'Noto Sans Thai', sans-serif;
    font-weight: 500;
    color: white;
}

.tagcloud--item {
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tagcloud--item:hover {
    background: rgba(214, 34, 100, 0.3);
    border-color: rgba(214, 34, 100, 0.5);
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(214, 34, 100, 0.4);
}

/* Pill badges with gradient by frequency tier */
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border-radius: 9999px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tag-pill:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(214, 34, 100, 0.3);
}

/* Large tags (high frequency) */
.tag-pill--lg {
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    background: linear-gradient(135deg, #D62264 0%, #FF6F3C 100%);
    box-shadow: 0 4px 15px rgba(214, 34, 100, 0.3);
}

/* Medium tags */
.tag-pill--md {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: linear-gradient(135deg, #8B5CF6 0%, #D62264 100%);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.2);
}

/* Small tags (low frequency) */
.tag-pill--sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Count badge inside pill */
.tag-count {
    font-size: 0.75em;
    opacity: 0.7;
    margin-left: 0.25rem;
}
