/* Animations: Scroll Reveal, Micro-Interactions, Page Transitions, Skeleton Loading, Back-to-Top, Breadcrumbs, Focus Visible, Reduced Motion, Print */

/* ============================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1), transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Stagger delays — 8 levels */
.reveal-delay-1 { transition-delay: 0.07s; }
.reveal-delay-2 { transition-delay: 0.14s; }
.reveal-delay-3 { transition-delay: 0.21s; }
.reveal-delay-4 { transition-delay: 0.28s; }
.reveal-delay-5 { transition-delay: 0.35s; }
.reveal-delay-6 { transition-delay: 0.42s; }
.reveal-delay-7 { transition-delay: 0.49s; }
.reveal-delay-8 { transition-delay: 0.56s; }

.reveal-left {
    opacity: 0;
    transform: translateX(-32px);
    transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1), transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(32px);
    transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1), transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.93);
    transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1), transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Zoom from slightly larger */
.reveal-zoom {
    opacity: 0;
    transform: scale(1.06);
    transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1), transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-zoom.visible {
    opacity: 1;
    transform: scale(1);
}

/* ============================================================
   FLOAT UTILITY
   ============================================================ */
.float {
    animation: floatY 4s ease-in-out infinite;
}
.float-slow {
    animation: floatY 7s ease-in-out infinite;
}
.float-fast {
    animation: floatY 2.5s ease-in-out infinite;
}

@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}

/* ============================================================
   CARD HOVER MICRO-INTERACTIONS
   ============================================================ */
.feature-card,
.service-card,
.support-option-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover  { transform: translateY(-8px) scale(1.01); }
.service-card:hover  { transform: translateY(-10px); }
.service-card.popular:hover { transform: scale(1.035) translateY(-10px); }

/* ============================================================
   SMOOTH PAGE TRANSITIONS
   ============================================================ */
@keyframes pageIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

main#main-content {
    animation: pageIn 0.45s ease-out;
}

/* ============================================================
   SKELETON LOADING
   ============================================================ */
@keyframes skeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton {
    background: linear-gradient(90deg,
        var(--bg-secondary) 25%,
        rgba(90, 79, 243, 0.06) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.6s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text    { height: 14px; margin-bottom: 8px; width: 80%; }
.skeleton-text-sm { height: 10px; margin-bottom: 6px; width: 60%; }
.skeleton-title   { height: 24px; margin-bottom: 12px; width: 50%; }
.skeleton-avatar  { width: 56px; height: 56px; border-radius: 50%; }

.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

/* ---- Enhanced Service Card Skeleton ---- */
.skeleton-service-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
}

.skeleton-service-card .skeleton-line {
    height: 16px;
    margin-bottom: 12px;
    border-radius: 4px;
}

.skeleton-service-card .skeleton-line-lg {
    height: 42px;
    width: 60%;
    margin-bottom: 16px;
    border-radius: 6px;
}

.skeleton-service-card .skeleton-line-sm {
    height: 12px;
    width: 80%;
    margin-bottom: 8px;
    border-radius: 3px;
}

.skeleton-service-card .skeleton-btn {
    height: 50px;
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
}

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(90, 79, 243, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: var(--z-sticky);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 10px 28px rgba(90, 79, 243, 0.5);
}

/* ============================================================
   NEWSLETTER (in CTA / footer)
   ============================================================ */
.newsletter-form {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 0.72rem 1rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-md);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.newsletter-form input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.newsletter-form input::placeholder { color: rgba(255, 255, 255, 0.55); }

.newsletter-form button {
    padding: 0.72rem 1.5rem;
    background: white;
    color: var(--accent-primary);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.newsletter-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumb-bar {
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

.breadcrumb-bar ol {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.82rem;
}

.breadcrumb-bar li { color: var(--text-muted); }

.breadcrumb-bar li::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--text-muted);
}

.breadcrumb-bar li:last-child::after { content: ''; }
.breadcrumb-bar li:last-child { color: var(--text-primary); font-weight: 600; }

.breadcrumb-bar a {
    color: var(--accent-primary);
    transition: color 0.2s;
}
.breadcrumb-bar a:hover { color: var(--accent-secondary); }

/* ============================================================
   FOCUS VISIBLE
   ============================================================ */
:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
}

/* ============================================================
   TEXT SHIMMER ANIMATION
   ============================================================ */
.text-shimmer {
    background: linear-gradient(90deg,
        var(--text-primary) 0%,
        var(--accent-primary) 40%,
        var(--accent-tertiary) 60%,
        var(--text-primary) 100%
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShimmerFlow 4s linear infinite;
}

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

/* ============================================================
   BUTTON RIPPLE MICRO-INTERACTION
   ============================================================ */
.ripple-host {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.32);
    transform: scale(0);
    animation: rippleExpand 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

@keyframes rippleExpand {
    to { transform: scale(4.5); opacity: 0; }
}

/* ============================================================
   CARD TILT (3D) MICRO-INTERACTION
   ============================================================ */
.tilt-card {
    transform-style: preserve-3d;
    will-change: transform;
}

.tilt-card .tilt-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 255, 255, 0.14) 0%,
        transparent 65%
    );
    z-index: 1;
}

.tilt-card:hover .tilt-shine { opacity: 1; }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .reveal-zoom {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .back-to-top,
    .float,
    .float-slow,
    .float-fast {
        animation: none;
        transition: none;
    }

    main#main-content { animation: none; }
}

/* ============================================================
   PRINT STYLESHEET
   ============================================================ */
@media print {
    header,
    footer,
    .back-to-top,
    .dark-toggle,
    .nav-toggle,
    .cta-section,
    .cta-mini,
    .support-options,
    .newsletter-form,
    #wfh-chat-widget,
    .floating-particles,
    .hero-particles {
        display: none !important;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    main#main-content {
        padding: 0;
        animation: none;
    }

    .content-page {
        padding: 2rem;
        max-width: 100%;
    }

    a { color: black; text-decoration: underline; }

    .hero,
    .features-section,
    .datacenter-section {
        background: white !important;
        min-height: auto;
        padding: 2rem;
    }

    .hero h1,
    .features-section h2,
    .datacenter-section h2 {
        font-size: 2rem;
        color: black !important;
        -webkit-text-fill-color: #000 !important;
    }

    .features-section::before,
    .datacenter-section::before { display: none !important; }

    .section-label,
    .hero-badge { color: #5A4FF3 !important; }

    .service-card,
    .feature-card,
    .faq-item {
        border: 1px solid #ccc !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    .service-card *,
    .feature-card *,
    .faq-item * { color: #000 !important; }

    .btn-buy,
    .btn-stripe,
    .btn-auth-submit {
        background: #5A4FF3 !important;
        color: #fff !important;
    }

    .gradient-text { -webkit-text-fill-color: #5A4FF3 !important; }
}

/* ============================================================
   CONTRAST HELPERS
   ============================================================ */
.text-muted { color: var(--text-muted) !important; }
