/* ================================================================
   Home Page Design Enhancement — home-design.css
   اختصاصی صفحه اصلی | app.css را تغییر نمی‌دهد
   ================================================================ */

/* ─── Prefers-reduced-motion override ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal,
    .reveal-scale,
    .reveal-left,
    .reveal-right {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ================================================================
   ۱. SCROLL REVEAL ANIMATIONS
   ================================================================ */

/* حالت اولیه — قبل از ظاهر شدن */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal="scale"] {
    transform: scale(0.95) translateY(16px);
}

[data-reveal="left"] {
    transform: translateX(36px) translateY(0);
}

[data-reveal="right"] {
    transform: translateX(-36px) translateY(0);
}

/* حالت نهایی — بعد از ظاهر شدن */
[data-reveal].is-revealed {
    opacity: 1;
    transform: none;
}

/* Stagger delays برای کارت‌های grid */
[data-reveal-delay="1"] { transition-delay: 0.06s !important; }
[data-reveal-delay="2"] { transition-delay: 0.12s !important; }
[data-reveal-delay="3"] { transition-delay: 0.18s !important; }
[data-reveal-delay="4"] { transition-delay: 0.24s !important; }
[data-reveal-delay="5"] { transition-delay: 0.30s !important; }
[data-reveal-delay="6"] { transition-delay: 0.36s !important; }

/* ================================================================
   ۲. HERO SECTION ENHANCEMENTS
   ================================================================ */

/* Floating Orb انیمیشن */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
    overflow-anchor: none;
}

.hero-orb-1 {
    top: -220px;
    left: 50%;
    width: 750px;
    height: 550px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.13) 0%, transparent 65%);
    animation: hero-float-1 9s ease-in-out infinite alternate;
}

.hero-orb-2 {
    top: 0;
    left: 5%;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(157, 78, 221, 0.09) 0%, transparent 65%);
    animation: hero-float-2 12s ease-in-out infinite alternate;
}

.hero-orb-3 {
    top: 30px;
    right: 5%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255, 183, 3, 0.07) 0%, transparent 65%);
    animation: hero-float-3 10s ease-in-out infinite alternate;
}

@keyframes hero-float-1 {
    0%   { transform: translateX(-50%) translateY(0px) scale(1); }
    100% { transform: translateX(-50%) translateY(-30px) scale(1.1); }
}

@keyframes hero-float-2 {
    0%   { transform: translateY(0px) scale(1) rotate(0deg); }
    100% { transform: translateY(-20px) scale(1.08) rotate(8deg); }
}

@keyframes hero-float-3 {
    0%   { transform: translateY(0px) scale(1); }
    100% { transform: translateY(-15px) scale(0.92); }
}

/* Hero Title Shimmer */
.hero-title {
    background: linear-gradient(
        135deg,
        #ffffff 0%,
        #d0eeff 25%,
        #00f0ff 50%,
        #9d4edd 75%,
        #ffffff 100%
    );
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: hero-shimmer 6s linear infinite;
}

@keyframes hero-shimmer {
    0%   { background-position: 0% center; }
    100% { background-position: -300% center; }
}

/* Hero Badge pulse بهتر */
.hero-badge {
    animation: hero-badge-pulse 3.5s ease-in-out infinite;
}

@keyframes hero-badge-pulse {
    0%, 100% {
        box-shadow: 0 0 12px rgba(0, 240, 255, 0.18), 0 0 0 0 rgba(0, 240, 255, 0.12);
    }
    50% {
        box-shadow: 0 0 24px rgba(0, 240, 255, 0.38), 0 0 0 8px rgba(0, 240, 255, 0);
    }
}

/* Hero Stats — hover glow رنگی اختصاصی */
.hero-stat-item {
    transition: transform 0.25s ease;
    cursor: default;
    border-radius: 10px;
    padding: 8px 12px;
}

.hero-stat-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.04);
}

/* ================================================================
   ۳. SECTION SEPARATORS (جداکننده‌های بصری)
   ================================================================ */

.home-section-sep {
    position: relative;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 240, 255, 0.22) 25%,
        rgba(255, 183, 3, 0.18) 60%,
        rgba(157, 78, 221, 0.15) 80%,
        transparent 100%
    );
    margin: 0 0 72px;
    overflow: visible;
}

.home-section-sep::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--accent-cyan, #00f0ff);
    border-radius: 50%;
    box-shadow:
        0 0 0 3px rgba(0, 240, 255, 0.15),
        0 0 12px rgba(0, 240, 255, 0.6);
    animation: sep-dot-pulse 3s ease-in-out infinite;
}

@keyframes sep-dot-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(0,240,255,0.15), 0 0 12px rgba(0,240,255,0.6); }
    50%       { box-shadow: 0 0 0 6px rgba(0,240,255,0.05), 0 0 22px rgba(0,240,255,0.9); }
}

/* ================================================================
   ۴. SECTION TITLE ENHANCED (Typography بهتر)
   ================================================================ */

.section-title-enhanced {
    font-size: clamp(24px, 4vw, 34px);
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 35%, #b8e2f2 70%, var(--accent-cyan, #00f0ff) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    line-height: 1.3;
    position: relative;
    display: inline-block;
}

/* خط تزئینی زیر عنوان‌های section */
.section-title-underline {
    display: block;
    width: 52px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-cyan, #00f0ff), var(--accent-gold, #ffb703));
    border-radius: 2px;
    margin: 10px auto 0;
    position: relative;
    overflow: hidden;
}

/* Shimmer روی خط تزئینی */
.section-title-underline::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
    animation: underline-shimmer 3s ease-in-out infinite 1.5s;
}

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

/* ================================================================
   ۵. GLASS CARD ENHANCEMENTS (کارت‌ها عمق بیشتر)
   ================================================================ */

/* Inner top highlight برای همه کارت‌های اصلی */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 18%;
    right: 18%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    pointer-events: none;
    border-radius: inherit;
}

/* Mouse-glow روی interactive cards */
.glass-card-interactive {
    --card-mouse-x: 50%;
    --card-mouse-y: 50%;
}

.glass-card-interactive::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--card-mouse-x) var(--card-mouse-y),
        rgba(0, 240, 255, 0.06) 0%,
        transparent 55%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    border-radius: inherit;
}

.glass-card-interactive:hover::after {
    opacity: 1;
}

/* ================================================================
   ۶. HOW IT WORKS — Steps Timeline
   ================================================================ */

/* خط اتصال بین step ها */
.steps-timeline-wrap {
    position: relative;
}

.steps-timeline-wrap::before {
    content: '';
    position: absolute;
    top: 40px; /* ارتفاع وسط آیکون‌های step */
    right: calc(100% / 8 + 12px);
    left: calc(100% / 8 + 12px);
    height: 2px;
    background: linear-gradient(
        90deg,
        var(--accent-cyan, #00f0ff),
        var(--accent-gold, #ffb703),
        var(--accent-emerald, #00e676),
        var(--accent-purple, #9d4edd)
    );
    opacity: 0.4;
    z-index: 0;
    border-radius: 1px;
}

/* Step card on top of connector */
.steps-timeline-wrap .glass-card {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.steps-timeline-wrap .glass-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.25);
}

/* Step number icon — ring animation */
.step-num-icon {
    position: relative;
    margin: 0 auto 16px;
}

.step-num-icon::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: inherit;
    border: 1px solid transparent;
    animation: step-icon-ring 2.5s ease-in-out infinite;
    animation-play-state: paused;
}

.steps-timeline-wrap .glass-card:hover .step-num-icon::after {
    animation-play-state: running;
}

@keyframes step-icon-ring {
    0%   { border-color: rgba(0, 240, 255, 0.6); transform: scale(1); opacity: 1; }
    100% { border-color: rgba(0, 240, 255, 0); transform: scale(1.5); opacity: 0; }
}

/* ================================================================
   ۷. TRUST / WHY CHOOSE US — Card Hover Enhancement
   ================================================================ */

.trust-feature-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid transparent;
    transition: all 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.trust-feature-item::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.15), transparent 70%);
    transition: transform 0.45s ease, opacity 0.45s ease;
    opacity: 0;
}

.trust-feature-item:hover {
    background: rgba(255, 255, 255, 0.025);
    border-color: rgba(0, 240, 255, 0.2);
    transform: translateX(-4px);
}

.trust-feature-item:hover::before {
    opacity: 1;
    transform: scale(2.2);
}

/* ================================================================
   ۸. SPACING RHYTHM (فاصله‌گذاری بهبود یافته)
   ================================================================ */

:root {
    --home-gap-sm:   52px;
    --home-gap-md:   76px;
    --home-gap-lg:   96px;
    --home-gap-xl:  120px;
}

/* Quick Calculator — بلافاصله بعد از hero */
#quick-calculator {
    margin-bottom: var(--home-gap-md) !important;
    scroll-margin-top: 100px;
}

/* Chart section */
.market-chart-section {
    margin-bottom: var(--home-gap-md) !important;
}

/* Product slider */
#product-showcase-slider {
    margin-bottom: var(--home-gap-lg) !important;
}

/* بخش‌های اصلی */
.home-section-platforms,
.home-section-how-it-works,
.home-section-why-us,
.home-section-reviews,
.home-section-blog {
    margin-bottom: var(--home-gap-lg) !important;
}

/* ================================================================
   ۹. BTN ENHANCEMENTS — Ripple + Better Hover
   ================================================================ */

/* Ripple on btn-gold */
.btn-gold {
    position: relative;
    overflow: hidden;
}

.btn-gold .btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: btn-ripple-anim 0.55s linear;
    pointer-events: none;
}

@keyframes btn-ripple-anim {
    to { transform: scale(4); opacity: 0; }
}

/* Shimmer sweep روی btn-gold */
.btn-gold::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -75%;
    width: 50%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.18),
        transparent
    );
    transform: skewX(-20deg);
    transition: none;
    pointer-events: none;
}

.btn-gold:hover::after {
    animation: btn-shimmer-sweep 0.55s ease;
}

@keyframes btn-shimmer-sweep {
    0%   { left: -75%; }
    100% { left: 150%; }
}

/* ================================================================
   ۱۰. HERO STATS COUNT-UP (آماده برای JS)
   ================================================================ */

.hero-stat-val[data-count-up] {
    font-variant-numeric: tabular-nums;
}

/* ================================================================
   ۱۱. QUICK CALCULATOR CARD — Enhanced
   ================================================================ */

/* Calculator section — بهتر از قبل */
#quick-calculator .glass-card {
    background: linear-gradient(145deg,
        rgba(20, 27, 45, 0.92),
        rgba(12, 16, 28, 0.96)
    );
    border-color: rgba(0, 240, 255, 0.2);
    box-shadow:
        0 0 0 1px rgba(0, 240, 255, 0.08),
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ================================================================
   ۱۲. CUSTOMER REVIEWS — Better Cards
   ================================================================ */

/* کارت‌های نظرات با quote mark تزئینی */
.review-card-enhanced {
    position: relative;
    overflow: hidden;
}

.review-card-enhanced::before {
    content: '❝';
    position: absolute;
    bottom: -10px;
    left: 16px;
    font-size: 80px;
    color: rgba(0, 240, 255, 0.05);
    line-height: 1;
    font-family: Georgia, serif;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

/* ================================================================
   ۱۳. BLOG SECTION — Image hover zoom + overlay
   ================================================================ */

/* بهبود hover روی تصاویر بلاگ */
.blog-card-img-wrap {
    position: relative;
    overflow: hidden;
}

.blog-card-img-wrap img {
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.blog-card-img-wrap:hover img {
    transform: scale(1.07) !important;
}

.blog-card-img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(9, 12, 20, 0.75) 0%, transparent 50%);
    pointer-events: none;
}

/* ================================================================
   ۱۴. HERO CANVAS (particle container)
   ================================================================ */

#hero-particles-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* اطمینان از اینکه محتوای hero روی canvas قرار دارد */
.hero-section > *:not(#hero-particles-canvas):not(.hero-orb) {
    position: relative;
    z-index: 1;
}

/* ================================================================
   ۱۵. SCROLL PROGRESS INDICATOR (نشانگر scroll بالای صفحه)
   ================================================================ */

.home-scroll-progress {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-cyan, #00f0ff), var(--accent-gold, #ffb703), var(--accent-purple, #9d4edd));
    transform-origin: right;
    transform: scaleX(0);
    z-index: 9999;
    overflow-anchor: none;
    will-change: transform;
}

/* ================================================================
   ۱۶. PLATFORM CARDS — Enhanced hover
   ================================================================ */

/* کارت‌های پلتفرم با glow رنگی هنگام hover */
.shop-platforms-grid .glass-card-interactive:hover {
    border-color: rgba(0, 240, 255, 0.45) !important;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.45),
        0 0 30px rgba(0, 240, 255, 0.18),
        inset 0 1px 0 rgba(0, 240, 255, 0.1) !important;
    transform: translateY(-6px) !important;
}

/* ================================================================
   ۱۷. RESPONSIVE ADJUSTMENTS
   ================================================================ */

@media (max-width: 1023px) {
    .steps-timeline-wrap::before {
        display: none; /* connector line فقط دسکتاپ */
    }

    :root {
        --home-gap-sm:  40px;
        --home-gap-md:  56px;
        --home-gap-lg:  72px;
        --home-gap-xl:  88px;
    }
}

@media (max-width: 767px) {
    .section-title-enhanced {
        font-size: 22px;
    }

    .home-section-sep {
        margin-bottom: 48px;
    }

    .hero-orb-1, .hero-orb-2, .hero-orb-3 {
        opacity: 0.6;
    }

    :root {
        --home-gap-sm:  32px;
        --home-gap-md:  44px;
        --home-gap-lg:  56px;
        --home-gap-xl:  68px;
    }

    .trust-feature-item:hover {
        transform: none; /* جلوگیری از layout shift روی موبایل */
    }
}
