/**
 * NOVA SMS — polish.css
 * Microinteractions, shimmer effects, skeleton screens.
 * Loaded after Tailwind CDN.
 */

/* ─── Scroll-aware reveals — initial state ─── */
/* CRITICAL: elements start invisible BUT auto-fade in after 1.5s if GSAP fails to load.
   This prevents permanent invisibility when CDN is blocked / network is slow. */
[data-reveal] {
    opacity: 0;
    animation: ak-reveal-fallback 0.6s ease-out 1.5s forwards;
}
[data-reveal-group] [data-reveal-item] {
    opacity: 0;
    animation: ak-reveal-fallback 0.6s ease-out 1.5s forwards;
}

@keyframes ak-reveal-fallback {
    to { opacity: 1; transform: none; }
}

/* When GSAP takes control, it overrides opacity inline — the CSS animation has no effect. */

/* If user prefers reduced motion: skip all animations */
@media (prefers-reduced-motion: reduce) {
    [data-reveal], [data-reveal-group] [data-reveal-item] {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
}

/* ─── Primary button shimmer on hover ─── */
.btn-shimmer {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.btn-shimmer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, 
        transparent 30%, 
        rgba(255, 255, 255, 0.25) 50%, 
        transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    pointer-events: none;
}
.btn-shimmer:hover::before {
    transform: translateX(100%);
}
.btn-shimmer > * {
    position: relative;
    z-index: 2;
}

/* ─── Card hover lift ─── */
.card-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s ease;
    will-change: transform;
}
.card-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px -8px rgba(0, 212, 170, 0.15),
                0 4px 12px -4px rgba(0, 0, 0, 0.3);
}

/* ─── Skeleton screen ─── */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.03) 0%, 
        rgba(255, 255, 255, 0.08) 50%, 
        rgba(255, 255, 255, 0.03) 100%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 6px;
}
@keyframes skeleton-pulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Pulse dot (waiting indicator) ─── */
.pulse-dot {
    position: relative;
}
.pulse-dot::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 8px; height: 8px;
    background: #00D4AA;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 0 rgba(0, 212, 170, 0.7);
    animation: pulse-ring 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(0, 212, 170, 0.7); }
    70%  { box-shadow: 0 0 0 12px rgba(0, 212, 170, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 212, 170, 0); }
}

/* ─── Form input focus glow ─── */
.input-glow:focus {
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15),
                inset 0 0 0 1px rgba(0, 212, 170, 0.6);
    outline: none;
}

/* ─── Smooth tab transitions ─── */
.tab-transition {
    position: relative;
    transition: color 0.2s ease;
}
.tab-transition::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #00D4AA;
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}
.tab-transition.active::after,
.tab-transition:hover::after {
    transform: scaleX(1);
}

/* ─── Glowing border on focus (forms) ─── */
.focus-glow:focus-within {
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.12);
    border-color: rgba(0, 212, 170, 0.5);
}

/* ─── Spin animation (loading spinner) ─── */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.animate-spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* ─── Soft bounce in (used for toast) ─── */
@keyframes soft-bounce-in {
    0%   { transform: translateX(40px); opacity: 0; }
    60%  { transform: translateX(-4px); opacity: 1; }
    100% { transform: translateX(0); }
}

/* ─── FAQ accordion icon (smooth rotate) ─── */
[data-faq-icon] {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-faq-item][data-open="1"] [data-faq-question] {
    color: #00D4AA;
}

/* ─── Custom scrollbar ─── */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 5px;
    border: 2px solid #0a0a0a;
}
::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

/* ─── Number ticker effect ─── */
[data-counter] {
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease;
}

/* ─── Disable animations during JS error / safety net ─── */
.no-animations [data-reveal],
.no-animations [data-reveal-item] {
    opacity: 1 !important;
    transform: none !important;
}

/* ─── Mobile-first responsive utility ─── */
@media (hover: none) {
    /* Reduce hover effects on touch devices */
    .card-lift:hover {
        transform: none;
    }
    .btn-shimmer::before {
        display: none;
    }
}
