/* css/styles.css - גרסה משופרת וידידותית למובייל */

/* ===== בסיסי וכללי ===== */
:root {
    /* משתני CSS שהיו ב-HTML, עכשיו הם כאן במקום מרכזי */
    --hero-pt: 6rem; /* ריווח עליון לדסקטופ */
    --hero-pb: 3rem; /* ריווח תחתון לדסקטופ */
    --color-bg: #111827; /* gray-900 */
    --color-primary: #a78bfa; /* purple-400 */
    --color-accent: #facc15; /* yellow-400 */
}

body {
    line-height: 1.6;
    font-family: 'Varela Round', sans-serif;
    overflow-x: hidden; /* חובה! מונע גלילה אופקית */
    background-color: #f8fafc;
    color: #374151;
    min-font-size: 16px; /* שיפור קריאות במובייל */
}

html {
    scroll-behavior: smooth;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
html::-webkit-scrollbar {
    display: none; /* Chrome, Safari, and Opera */
}

/* ===== טיפול ב-Header הנייח ===== */
#mainNav {
    transition: transform 0.3s ease-in-out;
    position: sticky; /* שיפור UX: דביק אבל לא fixed כדי לא לכסות תוכן */
    top: 0;
    z-index: 1000;
}
.nav-hidden {
    transform: translateY(-100%);
}

/* ===== רכיבים וקלאסים כלליים ===== */

/* קוד גישה במודאל */
.code-char {
    display: inline-block;
    width: 2rem;
    height: 2.5rem;
    line-height: 2.5rem;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0.125rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: #f3f4f6;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
    color: #1e3a8a;
}

/* Tooltip */
.tooltip { position: relative; display: inline-block; }
.tooltip .tooltiptext {
    visibility: hidden; width: 200px; background-color: #374151; color: #fff;
    text-align: center; border-radius: 6px; padding: 5px 8px; position: absolute;
    z-index: 10; bottom: 125%; left: 50%; margin-left: -100px; opacity: 0;
    transition: opacity 0.3s; font-size: 0.875rem;
}
.tooltip .tooltiptext::after {
    content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px;
    border-width: 5px; border-style: solid; border-color: #374151 transparent transparent transparent;
}
.tooltip:hover .tooltiptext, .tooltip:focus-within .tooltiptext { visibility: visible; opacity: 1; }

/* הסתרת אלמנטים בצורה נכונה */

/* רקע מטושטש למודאל */
.modal-overlay { background-color: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); }


/* ================================================= */
/* ============= התאמה לדסקטופ (מעל 768px) =========== */
/* ================================================= */
@media (min-width: 768px) {
    #hero {
        padding-top: var(--hero-pt);
        padding-bottom: 0;      /* מאפשר לדמות לשבת ממש על הקצה */
        min-height: 100vh;      /* גובה מלא לדסקטופ */
        display: flex;          /* כדי לאפשר יישורת תחתונה בעמודה השמאלית */
    }
    #hero .container {
        display: flex;
        align-items: stretch;   /* מאפשר לאלמנטי העמודות להימתח לגובה מלא */
        width: 100%;
    }
    /* ממרכז אנכית את עמודת הטקסט בדסקטופ */
    #hero .container > div:first-child {
        display: flex;
        flex-direction: column;
        justify-content: center;
        transform: translateY(-10%); /* מעלה מעט מעל המרכז */
    }
    #hero .container > div:last-child {
        display: flex;
        justify-content: center;
        align-items: flex-end;  /* מיישר את הדמות לתחתית ההירו */
    }
    /* גורם לתמונה לנצל את כל גובה ההירו הזמין מתחת להדר */
    #hero .container > div:last-child img {
        height: calc(100vh - var(--hero-pt));
        max-height: calc(100vh - var(--hero-pt));
        width: auto;
        object-fit: contain;
        display: block;
    }
    .code-char {
        width: 2.5rem;
        height: 3rem;
        line-height: 3rem;
        font-size: 1.25rem;
        margin: 0 0.25rem;
    }
    
    /* סידור הצעדים ב-"איך זה עובד" */
    #how-it-works .step-content-right { padding-left: 4rem; }
    #how-it-works .step-content-left { padding-right: 4rem; }
}


/* ================================================= */
/* ============= התאמה לטאבלטים (768px-1024px) ============= */
/* ================================================= */
@media (min-width: 768px) and (max-width: 1024px) {
    #hero h1 { font-size: 2.5rem; }
    #hero img { max-width: 80%; }
    section { padding: 4rem 2rem; }
    .container { max-width: 90%; }
}

/* ================================================= */
/* ============= התאמה למובייל (עד 767px) ============= */
/* ================================================= */
@media (max-width: 767px) {

    /* === כללי === */
    section {
        padding-top: 3.5rem; /* 56px */
        padding-bottom: 3.5rem; /* 56px */
        overflow-x: hidden; /* תיקון באג: מונע גלילה אופקית בסקשנים */
    }
    .container {
        padding-left: 1rem; /* 16px */
        padding-right: 1rem;
    }
    h2 { font-size: 1.875rem; line-height: 2.25rem; } /* text-3xl */
    h3 { font-size: 1.25rem; } /* text-xl */
    button, a.btn { /* שיפור UX: כפתורים ידידותיים למגע */
        min-width: 48px;
        min-height: 48px;
        padding: 0.75rem 1.5rem;
        transition: transform 0.2s;
    }
    button:hover, a.btn:hover { transform: scale(1.05); } /* אנימציה קלה */

    /* === Header === */

    #mainNav {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    /* === Hero Section (ממלא מסך ומיישר את הדמות לתחתית) === */
#hero {
    padding-top: 5.5rem;  /* (88px) מפנה מקום להדר הדביק */
    padding-bottom: 0;    /* מאפשר לדמות לשבת ממש על קו התחתית */
    min-height: 100dvh;   /* גובה מלא של חלון התצוגה במובייל */
    text-align: center;
    display: flex;        /* כדי שהקונטיינר יוכל להימתח לגובה מלא */
}
#hero .container {
    /* טקסט למעלה, דמות בתחתית */
    display: flex;
    flex-direction: column; /* הדמות תהיה האלמנט האחרון ותשב למטה */
    justify-content: space-between; /* פיזור בין הטקסט (למעלה) לדמות (למטה) */
    align-items: center;
    gap: 1.5rem; /* רווח בין התמונה לטקסט */
    width: 100%;
}
/* מוודא שהאלמנט האחרון (קופסת התמונה) יישר קו לתחתית */
#hero .container > div:last-child {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}
#hero h1 {
    font-size: 2.25rem; /* text-4xl */
    line-height: 1.25;
}
#hero p {
    font-size: 1rem; /* text-base */
    max-width: 95%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem; /* רווח לפני הכפתורים */
}
#hero .w-full.md\:w-3\/5 { /* הקונטיינר של הטקסט */
    width: 100%;
    margin-bottom: 0; /* איפסנו את המרווח התחתון */
    padding: 0;
}
#hero .w-full.md\:w-2\/5 { /* הקונטיינר של התמונה */
    width: 100%;
    display: flex;
    justify-content: center;
}
#hero img {
    transform: scale(1) !important;
    max-width: 70%;
    height: auto;
    object-fit: contain;
}
#hero .sm\:space-x-4 { /* הקונטיינר של הכפתורים */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

    /* === Features Section === */
    #features .grid-cols-1 {
        gap: 1.5rem; /* מקטין רווח בין הקלפים */
    }
    
    /* === AI Power & Security Sections === */
    #ai-power .md\:flex-row, #security .md\:flex-row {
        flex-direction: column;
    }
    #ai-power .order-1, #security .order-1 { order: 1; }
    #ai-power .order-2, #security .order-2 { order: 2; }
    #ai-power .md\:w-1\/2, #security .md\:w-1\/2, #security .md\:w-3\/5 {
        width: 100%;
        padding: 0;
        text-align: center;
    }
    #ai-power img, #security img {
        max-width: 60%;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 2rem;
    }
    #ai-power ul, #security ul {
        text-align: right; /* מיישר את הטקסט ברשימות לימין */
        display: inline-block; /* כדי שהיישור יתפוס */
    }

    /* === How It Works Section === */
    #how-it-works .absolute.left-1\/2 {
        display: none; /* מסתיר את הקו האנכי */
    }
    #how-it-works .space-y-24 {
        space-y: 4rem; /* מקטין את המרווח בין הצעדים */
    }
    #how-it-works .how-it-works-step-mobile {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    #how-it-works .md\:w-3\/5, #how-it-works .md\:w-2\/5 {
        width: 100%;
        padding: 0 !important; /* מאפס ריווחים של דסקטופ */
    }
    #how-it-works .md\:pl-16, #how-it-works .md\:pr-16 {
        padding: 0 !important;
    }
    #how-it-works .w-16.h-16 { /* עיגול המספר */
        margin-bottom: 1rem;
    }
     #how-it-works h3 {
        text-align: center !important;
    }
    #how-it-works p {
        text-align: center !important;
        max-width: 90%;
        margin: 0 auto;
    }
    
    /* === Payment & Code Modals === */
    #paymentModal .md\:flex-row {
        flex-direction: column-reverse; /* שם את טופס הפרטים למעלה */
    }
    #paymentModal .md\:w-1\/2 {
        width: 100%;
        border-right: none !important;
    }
    #paymentModal .transform {
        max-height: 90vh; /* שיפור UX: מונע חריגה מהמסך */
        overflow-y: auto;
    }
    .modal-content {
        max-width: 95vw; /* וידוא שהמודאל לא רחב מדי */
    }
    
    /* === Footer === */
    footer .text-2xl > a {
        font-size: 1.5rem; /* מקטין אייקונים חברתיים */
    }
    footer .space-x-6 {
        gap: 1rem;
 
    }
}

/* --- Navigation --- */
#mainNav {
    background-color: transparent;
}
#mainNav.scrolled {
    background-color: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(107, 33, 168, 0.3);
}

.nav-link {
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s;
    color: #d1d5db; /* gray-300 */
}
.nav-link:hover {
    color: white;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    right: 0;
    background-color: var(--color-accent);
    transition: width 0.3s ease-out;
}
.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
    left: 0;
    right: auto;
}
.nav-link.active {
    color: white;
    font-weight: bold;
}
.new-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.6), 0 0 30px rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5), 0 0 25px rgba(255, 215, 0, 0.3);
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    margin-left: 0.25rem;
    animation: goldGlow 2s ease-in-out infinite alternate;
}

@keyframes goldGlow {
    from {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.6), 0 0 30px rgba(255, 215, 0, 0.4);
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.5), 0 0 25px rgba(255, 215, 0, 0.3);
    }
    to {
        text-shadow: 0 0 15px rgba(255, 215, 0, 1), 0 0 25px rgba(255, 215, 0, 0.8), 0 0 35px rgba(255, 215, 0, 0.6);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.7), 0 0 30px rgba(255, 215, 0, 0.5);
    }
}

/* --- Hero Section & Animations --- */
#hero-monitor {
    background: radial-gradient(ellipse at 70% 30%, rgba(107, 33, 168, 0.25) 0%, rgba(17, 24, 39, 0) 60%);
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}
.blob-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    filter: blur(80px);
    animation: blob-anim 20s infinite alternate;
}
.blob-1 {
    width: 400px;
    height: 400px;
    top: 10%;
    right: -100px;
    background: #8b5cf6; /* violet-500 */
}
.blob-2 {
    width: 300px;
    height: 300px;
    bottom: 5%;
    left: -80px;
    background: #3b82f6; /* blue-500 */
    animation-duration: 25s;
}
@keyframes blob-anim {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(40px, -60px) scale(1.1); }
}

/* --- קוד חדש ומעודכן --- */
.floating-anim {
    /* מגדירים את נקודת העוגן של האנימציה לתחתית התמונה */
    transform-origin: bottom center; 
    /* מחברים את התמונה לאנימציה החדשה */
    animation: gentle-float 4s ease-in-out infinite; /* הקטנת משך למובייל */
}

/* הגדרת אנימציה חדשה שלא מרימה את התמונה */
@keyframes gentle-float {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        /* הגדלה קלה וסיבוב עדין במקום הרמה */
        transform: scale(1.03) rotate(-1deg);
    }
}

/* כיבוד משתמשים עם reduced motion */
@media (prefers-reduced-motion: reduce) {
    .floating-anim, .blob-shape, .shield-icon {
        animation: none !important;
    }
}

/* --- How It Works Timeline --- */
.timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    position: relative;
}
.timeline-item {
    background: rgba(31, 41, 55, 0.4); /* gray-800/40 */
    border: 1px solid rgba(75, 85, 99, 0.3); /* gray-700/30 */
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}
.timeline-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
}
.timeline-item code {
    background-color: rgba(55, 65, 81, 1);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-family: monospace;
    color: #facc15; /* yellow-400 */
}

.timeline-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Privacy Shield Animation --- */
.shield-container {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shield-icon {
    width: 100%; height: 100%;
    stroke: #6366f1; /* indigo-500 */
    fill: #6366f120;
    filter: drop-shadow(0 0 15px #6366f180);
    animation: pulse 4s ease-in-out infinite;
}
.lock-icon {
    position: absolute;
    width: 60px; height: 60px;
    stroke: #a5b4fc; /* indigo-300 */
    stroke-width: 1.5;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 15px #6366f180); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 25px #6366f1c0); }
}


/* --- Modal Styles --- */
.modal-hidden {
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.modal-content {
    position: relative;
    background: #1f2937; /* gray-800 */
    border: 1px solid rgba(107, 33, 168, 0.5); /* purple-800/50 */
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-hidden .modal-content {
    transform: scale(0.95);
    opacity: 0;
}
body:not(.modal-hidden) .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* Payment loader */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(59, 130, 246, 0.3);
    border-top-color: #3b82f6; /* blue-500 */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 1rem auto 0;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}


/* --- Reveal on Scroll Animations --- */
.reveal-fade-left, .reveal-fade-right, .reveal-card {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.reveal-fade-left { transform: translateX(-30px); }
.reveal-fade-right { transform: translateX(30px); }
.reveal-card { transform: translateY(40px); }

.reveal-visible {
    opacity: 1;
    transform: none;
}