/* ==========================================================================
   Premium UI Enhancements
   Word Search Puzzles — Premium stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Scroll-Reveal Animation
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay utilities */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* --------------------------------------------------------------------------
   2. Scroll-to-Top Button
   -------------------------------------------------------------------------- */
#scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.35);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 40;
    pointer-events: none;
}

#scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(79, 70, 229, 0.5);
}

/* --------------------------------------------------------------------------
   3. Premium Card Styles
   -------------------------------------------------------------------------- */
.premium-card {
    background: white;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 1rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed, #ec4899);
    opacity: 0;
    transition: opacity 0.3s;
}

.premium-card:hover {
    border-color: rgba(79, 70, 229, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(79, 70, 229, 0.15);
}

.premium-card:hover::before {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   4. Skeleton Loading
   -------------------------------------------------------------------------- */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

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

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

::-webkit-scrollbar-track {
    background: #f8fafc;
}

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

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #818cf8, #6366f1);
}

/* --------------------------------------------------------------------------
   6. Animated Gradient Text
   -------------------------------------------------------------------------- */
.gradient-text-animated {
    background: linear-gradient(270deg, #4f46e5, #7c3aed, #ec4899, #4f46e5);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 6s ease infinite;
}

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

/* --------------------------------------------------------------------------
   7. Floating Decoration Animation
   -------------------------------------------------------------------------- */
.float-decoration {
    position: absolute;
    animation: float-around 6s ease-in-out infinite;
    pointer-events: none;
    opacity: 0.15;
    font-size: 2.5rem;
}

@keyframes float-around {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25%      { transform: translateY(-15px) rotate(5deg); }
    75%      { transform: translateY(10px) rotate(-3deg); }
}

.float-decoration:nth-child(2) { animation-delay: -2s; }
.float-decoration:nth-child(3) { animation-delay: -4s; }

/* --------------------------------------------------------------------------
   8. Confetti Canvas
   -------------------------------------------------------------------------- */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* --------------------------------------------------------------------------
   9. Pulsing Badge
   -------------------------------------------------------------------------- */
.pulse-badge {
    animation: pulse-soft 2s ease-in-out infinite;
}

@keyframes pulse-soft {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

/* --------------------------------------------------------------------------
   10. Mobile Drawer
   -------------------------------------------------------------------------- */
.mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.mobile-drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 80vw;
    background: linear-gradient(180deg, #312e81, #1e1b4b);
    z-index: 70;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 1.5rem;
    overflow-y: auto;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
}

.mobile-drawer.open {
    transform: translateX(0);
}

/* --------------------------------------------------------------------------
   11. Wave Divider (Footer)
   -------------------------------------------------------------------------- */
.wave-divider {
    position: relative;
    overflow: hidden;
}

.wave-divider::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 40px;
    background: #f9fafb; /* bg-gray-50 */
    clip-path: ellipse(55% 100% at 50% 0%);
}

/* --------------------------------------------------------------------------
   12. Enhanced Pagination
   -------------------------------------------------------------------------- */
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    transition: all 0.2s;
}

.pagination-btn:hover {
    border-color: #4f46e5;
    color: #4f46e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

/* --------------------------------------------------------------------------
   13. Search Hero
   -------------------------------------------------------------------------- */
.search-hero {
    text-align: center;
    padding: 3rem 1rem;
    position: relative;
}

.search-input-large {
    width: 100%;
    max-width: 600px;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    background: white;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.search-input-large:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 4px 25px rgba(79, 70, 229, 0.15);
}

/* --------------------------------------------------------------------------
   Print Styles — hide premium UI elements when printing
   -------------------------------------------------------------------------- */
@media print {
    #scroll-to-top,
    #confetti-canvas,
    .mobile-drawer-backdrop,
    .mobile-drawer,
    .float-decoration,
    .pulse-badge,
    .skeleton {
        display: none !important;
    }

    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    .premium-card {
        box-shadow: none !important;
        border: 1px solid #d1d5db !important;
        transform: none !important;
    }

    .premium-card::before {
        display: none !important;
    }

    .gradient-text-animated {
        -webkit-text-fill-color: #1e1b4b !important;
        color: #1e1b4b !important;
        animation: none !important;
    }

    .wave-divider::before {
        display: none !important;
    }
}
