/* ═══════════════════════════════════════════════════════════
   NP BOOKING — POLISH LAYER v2.0
   Pro animations, spring physics, magnetic effects, shimmer.
   Does NOT change layout or functionality.
   ═══════════════════════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════════════════════
   ENTRANCE ANIMATIONS
   Snappy spring easing: cubic-bezier(0.16, 1, 0.3, 1)
   Matches the iOS/macOS spring feel — fast start, smooth land.
   ═══════════════════════════════════════════════════════════ */

/* Slide up (default) */
.polish-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.polish-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slide from left */
.polish-animate-left {
    opacity: 0;
    transform: translateX(-28px);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.polish-animate-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Slide from right */
.polish-animate-right {
    opacity: 0;
    transform: translateX(28px);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.polish-animate-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale-up pop-in */
.polish-animate-pop {
    opacity: 0;
    transform: scale(0.88);
    transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: opacity, transform;
}
.polish-animate-pop.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* Fade-in only (no translate) */
.polish-fade {
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity;
}
.polish-fade.is-visible {
    opacity: 1;
}

/* Scale-in */
.polish-scale {
    opacity: 0;
    transform: scale(0.94);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.polish-scale.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* ── Staggered children — 40ms per item (skill: 30-50ms) ── */
.polish-stagger > *:nth-child(1)  { transition-delay: 0ms; }
.polish-stagger > *:nth-child(2)  { transition-delay: 40ms; }
.polish-stagger > *:nth-child(3)  { transition-delay: 80ms; }
.polish-stagger > *:nth-child(4)  { transition-delay: 120ms; }
.polish-stagger > *:nth-child(5)  { transition-delay: 160ms; }
.polish-stagger > *:nth-child(6)  { transition-delay: 200ms; }
.polish-stagger > *:nth-child(7)  { transition-delay: 240ms; }
.polish-stagger > *:nth-child(8)  { transition-delay: 280ms; }
.polish-stagger > *:nth-child(9)  { transition-delay: 320ms; }
.polish-stagger > *:nth-child(10) { transition-delay: 360ms; }
.polish-stagger > *:nth-child(11) { transition-delay: 400ms; }
.polish-stagger > *:nth-child(12) { transition-delay: 440ms; }
.polish-stagger > *:nth-child(n+13) { transition-delay: 480ms; }

/* Faster stagger variant for dense grids (30ms) */
.polish-stagger-fast > *:nth-child(1)  { transition-delay: 0ms; }
.polish-stagger-fast > *:nth-child(2)  { transition-delay: 30ms; }
.polish-stagger-fast > *:nth-child(3)  { transition-delay: 60ms; }
.polish-stagger-fast > *:nth-child(4)  { transition-delay: 90ms; }
.polish-stagger-fast > *:nth-child(5)  { transition-delay: 120ms; }
.polish-stagger-fast > *:nth-child(6)  { transition-delay: 150ms; }
.polish-stagger-fast > *:nth-child(7)  { transition-delay: 180ms; }
.polish-stagger-fast > *:nth-child(8)  { transition-delay: 210ms; }
.polish-stagger-fast > *:nth-child(n+9) { transition-delay: 240ms; }

/* ═══════════════════════════════════════════════════════════
   CARD INTERACTIONS
   ═══════════════════════════════════════════════════════════ */

.polish-card {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s ease;
    will-change: transform;
}
.polish-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.13), 0 4px 12px rgba(15, 23, 42, 0.07);
}
@media (max-width: 768px) {
    .polish-card:hover {
        transform: none;
        box-shadow: none;
    }
    .polish-card:active {
        transform: scale(0.97);
        transition-duration: 0.1s;
    }
}

/* 3D Tilt card — JS applies rotateX/Y via style, CSS does timing */
.polish-tilt {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    transform-style: preserve-3d;
}
.polish-tilt:hover {
    /* JS handles depth; CSS provides base shadow */
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
}

/* Card with color glow on hover (for feature cards etc.) */
.polish-card-glow {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s ease;
}
.polish-card-glow:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(255, 61, 104, 0.18), 0 4px 12px rgba(255, 61, 104, 0.1);
}

/* ═══════════════════════════════════════════════════════════
   BUTTON INTERACTIONS
   ═══════════════════════════════════════════════════════════ */

.polish-btn {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.polish-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.18);
}
.polish-btn:active {
    transform: translateY(0) scale(0.95);
    box-shadow: none;
    transition-duration: 0.08s;
}
.polish-btn:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 3px;
}

/* Ripple effect on click */
.polish-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%), rgba(255,255,255,0.35) 0%, transparent 65%);
    transform: scale(3);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.polish-btn:active::after {
    opacity: 1;
    transform: scale(0);
    transition: 0s;
}

/* Glow primary button (brand pink glow) */
.polish-glow-btn {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.25s ease;
    position: relative;
}
.polish-glow-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255, 61, 104, 0.45), 0 2px 8px rgba(255, 61, 104, 0.25);
}
.polish-glow-btn:active {
    transform: translateY(0) scale(0.96);
    box-shadow: none;
    transition-duration: 0.08s;
}

/* Glow accent button (trust blue glow) */
.polish-glow-btn-blue {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.25s ease;
}
.polish-glow-btn-blue:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(14, 165, 233, 0.4), 0 2px 8px rgba(14, 165, 233, 0.2);
}
.polish-glow-btn-blue:active {
    transform: scale(0.96);
    transition-duration: 0.08s;
}

/* Magnetic button — JS handles translation, CSS handles timing */
.polish-magnetic {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════
   TEXT EFFECTS
   ═══════════════════════════════════════════════════════════ */

/* Gradient shimmer text — brand pink sweep */
.polish-shimmer-text {
    background: linear-gradient(
        90deg,
        #FF3D68 0%,
        #FF8F66 25%,
        #FF3D68 50%,
        #e91e8c 75%,
        #FF3D68 100%
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: polishTextShimmer 4s linear infinite;
}

/* Indigo shimmer text variant (for dark hero sections) */
.polish-shimmer-text-indigo {
    background: linear-gradient(
        90deg,
        #818cf8 0%,
        #c084fc 30%,
        #818cf8 60%,
        #60a5fa 80%,
        #818cf8 100%
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: polishTextShimmer 4s linear infinite;
}

@keyframes polishTextShimmer {
    0%   { background-position: 0% center; }
    100% { background-position: 250% center; }
}

/* ═══════════════════════════════════════════════════════════
   BADGE & INDICATOR EFFECTS
   ═══════════════════════════════════════════════════════════ */

/* Pulsing ring — for "popular", "new", "live" badges */
.polish-badge-pulse {
    position: relative;
    z-index: 0;
}
.polish-badge-pulse::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: inherit;
    background: currentColor;
    opacity: 0;
    z-index: -1;
    animation: polishBadgePulse 2.2s ease-out infinite;
}
@keyframes polishBadgePulse {
    0%   { transform: scale(0.9); opacity: 0.4; }
    80%  { transform: scale(1.6); opacity: 0; }
    100% { opacity: 0; }
}

/* Green live dot — for "online now" / "live" indicators */
.polish-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    position: relative;
}
.polish-live-dot::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: #10B981;
    opacity: 0;
    animation: polishBadgePulse 2s ease-out infinite;
}

/* ═══════════════════════════════════════════════════════════
   FLOATING ANIMATIONS (decorative elements)
   ═══════════════════════════════════════════════════════════ */

.polish-float {
    animation: polishFloat 3.5s ease-in-out infinite;
    will-change: transform;
}
.polish-float-slow {
    animation: polishFloat 5s ease-in-out infinite;
    will-change: transform;
}
.polish-float-delayed {
    animation: polishFloat 3.5s ease-in-out infinite;
    animation-delay: 1.2s;
    will-change: transform;
}
.polish-float-alt {
    animation: polishFloatAlt 4s ease-in-out infinite;
    will-change: transform;
}

@keyframes polishFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}
@keyframes polishFloatAlt {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%       { transform: translateY(-8px) rotate(3deg); }
}

/* ═══════════════════════════════════════════════════════════
   NUMBER / COUNTER EFFECTS
   ═══════════════════════════════════════════════════════════ */

/* Tabular figures for all animated counters */
.polish-number,
[data-count] {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* Bump on update */
.polish-counter {
    display: inline-block;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.polish-counter.bump {
    transform: scale(1.15);
}

/* ═══════════════════════════════════════════════════════════
   SKELETON SHIMMER (improved)
   ═══════════════════════════════════════════════════════════ */

.polish-skeleton {
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 40%, #f1f5f9 80%);
    background-size: 300% 100%;
    animation: polishSkeleton 1.8s ease-in-out infinite;
    border-radius: 8px;
}
@keyframes polishSkeleton {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ═══════════════════════════════════════════════════════════
   GLASSMORPHISM NAVBAR ON SCROLL
   ═══════════════════════════════════════════════════════════ */

.polish-nav-glass {
    transition: background 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}
.polish-nav-glass.scrolled {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06), 0 4px 24px rgba(15, 23, 42, 0.06);
}

/* ═══════════════════════════════════════════════════════════
   IMAGE LAZY-LOAD FADE
   ═══════════════════════════════════════════════════════════ */

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.4s ease;
}
img[loading="lazy"].loaded {
    opacity: 1;
}
img[loading="lazy"][complete] {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════
   RATING BAR ANIMATION
   ═══════════════════════════════════════════════════════════ */

.polish-rating-bar .rating-fill {
    width: 0 !important;
    transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}

/* ═══════════════════════════════════════════════════════════
   MISC MICRO-INTERACTIONS
   ═══════════════════════════════════════════════════════════ */

/* Chip/Tag hover */
.polish-chip {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}
.polish-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.polish-chip:active {
    transform: scale(0.96);
    transition-duration: 0.08s;
}

/* Page Transition */
.polish-page-enter {
    animation: polishPageIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes polishPageIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Tooltip */
.polish-tooltip {
    position: relative;
}
.polish-tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: #0f172a;
    color: white;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    letter-spacing: 0.01em;
}
.polish-tooltip::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    border: 5px solid transparent;
    border-top-color: #0f172a;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.polish-tooltip:hover::before,
.polish-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Star Rating Hover */
.polish-stars .fa-star {
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s ease;
    cursor: pointer;
}
.polish-stars:hover .fa-star {
    transform: scale(1.2);
}
.polish-stars .fa-star:hover ~ .fa-star {
    transform: none;
}

/* Section Divider */
.polish-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e2e8f0 20%, #e2e8f0 80%, transparent);
    border: none;
}

/* Animated gradient border — for highlighted cards/CTAs */
.polish-gradient-border {
    position: relative;
    z-index: 0;
}
.polish-gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #FF3D68, #818cf8, #0EA5E9, #FF3D68);
    background-size: 300% 300%;
    z-index: -1;
    animation: polishBorderShift 4s ease infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.polish-gradient-border:hover::before {
    opacity: 1;
}
@keyframes polishBorderShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ── Focus Ring Global ── */
:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.6);
    outline-offset: 3px;
    border-radius: 5px;
}

/* ═══════════════════════════════════════════════════════════
   REDUCED MOTION — Respect user preference
   ═══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .polish-animate,
    .polish-animate-left,
    .polish-animate-right,
    .polish-animate-pop,
    .polish-fade,
    .polish-scale {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .polish-float,
    .polish-float-slow,
    .polish-float-delayed,
    .polish-float-alt,
    .polish-badge-pulse::before,
    .polish-live-dot::before,
    .polish-shimmer-text,
    .polish-shimmer-text-indigo,
    .polish-skeleton,
    .polish-gradient-border::before {
        animation: none !important;
    }
}
