/* ═══════════════════════════════════════════════════════════════════
   Gilaf Store — Onboarding Tour
   Premium guided walkthrough — isolated component
   Prefix: .gf-tour-* (no global conflicts)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Overlay ── */
.gf-tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.gf-tour-overlay.gf-tour-active {
    opacity: 1;
    visibility: visible;
}

/* ── Elevated stacking context for target parents ── */
.gf-tour-elevated {
    z-index: 99999 !important;
    position: relative;
}

/* ── Target element highlight ── */
.gf-tour-target {
    position: relative !important;
    z-index: 99999 !important;
    border-radius: 8px;
    box-shadow: 0 0 0 4px rgba(26, 60, 52, 0.4), 0 0 20px rgba(26, 60, 52, 0.15) !important;
    transition: box-shadow 0.3s ease;
}

.gf-tour-target-pulse {
    animation: gfTourPulse 2s ease-in-out infinite;
}

@keyframes gfTourPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(26, 60, 52, 0.4), 0 0 20px rgba(26, 60, 52, 0.15); }
    50% { box-shadow: 0 0 0 6px rgba(26, 60, 52, 0.25), 0 0 30px rgba(26, 60, 52, 0.1); }
}

/* ── Tooltip Card ── */
.gf-tour-tooltip {
    position: fixed;
    z-index: 100000;
    background: #ffffff;
    border-radius: 14px;
    padding: 24px 26px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.06);
    width: 320px;
    max-width: calc(100vw - 32px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.96);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.gf-tour-tooltip.gf-tour-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.gf-tour-tooltip-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1A3C34;
    margin-bottom: 8px;
    line-height: 1.3;
}

.gf-tour-tooltip-desc {
    font-size: 0.88rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 18px;
}

/* ── Tooltip Arrow ── */
.gf-tour-arrow {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #ffffff;
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.04);
}

.gf-tour-arrow-top {
    top: -7px;
    left: 50%;
    margin-left: -7px;
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.04);
}

.gf-tour-arrow-bottom {
    bottom: -7px;
    left: 50%;
    margin-left: -7px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.04);
}

.gf-tour-arrow-left {
    left: -7px;
    top: 50%;
    margin-top: -7px;
    box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.04);
}

.gf-tour-arrow-right {
    right: -7px;
    top: 50%;
    margin-top: -7px;
    box-shadow: 2px -2px 4px rgba(0, 0, 0, 0.04);
}

/* ── Footer (step indicator + buttons) ── */
.gf-tour-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.gf-tour-step-indicator {
    font-size: 0.8rem;
    font-weight: 500;
    color: #9ca3af;
    white-space: nowrap;
}

.gf-tour-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gf-tour-btn-next {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: #1A3C34;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.gf-tour-btn-next:hover {
    background: #15302a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 60, 52, 0.25);
}

.gf-tour-btn-next:active {
    transform: translateY(0);
}

.gf-tour-btn-next svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.gf-tour-btn-prev {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: transparent;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.gf-tour-btn-prev:hover {
    border-color: #d1d5db;
    color: #374151;
    background: #f9fafb;
}

.gf-tour-btn-skip {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 10px;
    transition: color 0.2s;
    font-family: inherit;
}

.gf-tour-btn-skip:hover {
    color: #6b7280;
}

.gf-tour-btn-finish {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: #1A3C34;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.gf-tour-btn-finish:hover {
    background: #15302a;
    box-shadow: 0 4px 12px rgba(26, 60, 52, 0.25);
}

.gf-tour-btn-finish svg {
    width: 14px;
    height: 14px;
}

/* ═══════════════════════════════════════════════════════════════════
   Welcome Modal (Step 1)
   ═══════════════════════════════════════════════════════════════════ */
.gf-tour-welcome {
    position: fixed;
    z-index: 100000;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    background: #ffffff;
    border-radius: 18px;
    padding: 40px 36px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.08);
    text-align: center;
    width: 360px;
    max-width: calc(100vw - 32px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.gf-tour-welcome.gf-tour-active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.gf-tour-welcome-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: #f0fdf4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #dcfce7;
}

.gf-tour-welcome-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.gf-tour-welcome h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1A3C34;
    margin-bottom: 10px;
    font-family: 'Playfair Display', serif;
}

.gf-tour-welcome p {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 28px;
}

.gf-tour-welcome-start {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: #1A3C34;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 12px;
    font-family: inherit;
    letter-spacing: 0.02em;
}

.gf-tour-welcome-start:hover {
    background: #15302a;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26, 60, 52, 0.3);
}

.gf-tour-welcome-skip {
    display: block;
    width: 100%;
    padding: 10px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
    font-family: inherit;
}

.gf-tour-welcome-skip:hover {
    color: #6b7280;
}

/* ═══════════════════════════════════════════════════════════════════
   Completion Modal (Final Step)
   ═══════════════════════════════════════════════════════════════════ */
.gf-tour-complete {
    position: fixed;
    z-index: 100000;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    background: #ffffff;
    border-radius: 18px;
    padding: 40px 30px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.08);
    text-align: center;
    width: 520px;
    max-width: calc(100vw - 32px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.gf-tour-complete.gf-tour-active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.gf-tour-complete h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1A3C34;
    margin-bottom: 10px;
    font-family: 'Playfair Display', serif;
}

.gf-tour-complete p {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.gf-tour-complete-btn {
    display: inline-block;
    padding: 13px 28px;
    background: #1A3C34;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 28px;
    font-family: inherit;
    letter-spacing: 0.02em;
}

.gf-tour-complete-btn:hover {
    background: #15302a;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26, 60, 52, 0.3);
}

/* Benefit icons row */
.gf-tour-benefits {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid #f0f1f3;
}

.gf-tour-benefit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 80px;
}

.gf-tour-benefit-icon {
    width: 40px;
    height: 40px;
    background: #f0fdf4;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1A3C34;
    font-size: 1rem;
}

.gf-tour-benefit span {
    font-size: 0.68rem;
    color: #6b7280;
    text-align: center;
    line-height: 1.3;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════
   Responsive — Tablet
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .gf-tour-tooltip {
        width: 290px;
        padding: 20px 22px;
    }

    .gf-tour-tooltip-title {
        font-size: 0.98rem;
    }

    .gf-tour-tooltip-desc {
        font-size: 0.84rem;
        margin-bottom: 14px;
    }

    .gf-tour-welcome {
        width: 320px;
        padding: 32px 28px 28px;
    }

    .gf-tour-complete {
        width: 340px;
        padding: 32px 22px 28px;
    }

    .gf-tour-benefits {
        gap: 12px;
    }

    .gf-tour-benefit {
        width: 65px;
    }

    .gf-tour-benefit-icon {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    .gf-tour-benefit span {
        font-size: 0.62rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   Responsive — Mobile
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .gf-tour-tooltip {
        width: calc(100vw - 24px);
        left: 12px !important;
        right: 12px !important;
        padding: 18px 18px;
        border-radius: 12px;
    }

    .gf-tour-tooltip-title {
        font-size: 0.92rem;
    }

    .gf-tour-tooltip-desc {
        font-size: 0.82rem;
    }

    .gf-tour-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

    .gf-tour-welcome {
        width: calc(100vw - 24px);
        padding: 28px 22px 24px;
        border-radius: 14px;
    }

    .gf-tour-welcome h2 {
        font-size: 1.15rem;
    }

    .gf-tour-complete {
        width: calc(100vw - 24px);
        padding: 28px 18px 24px;
        border-radius: 14px;
    }

    .gf-tour-complete h2 {
        font-size: 1.15rem;
    }

    .gf-tour-benefits {
        gap: 8px;
    }

    .gf-tour-benefit {
        width: 58px;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   Accessibility — Reduced Motion
   ═══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .gf-tour-overlay,
    .gf-tour-tooltip,
    .gf-tour-welcome,
    .gf-tour-complete {
        transition: none;
    }

    .gf-tour-target-pulse {
        animation: none;
    }
}
