:root {
    /* הגדרת גווני הרקע המשתלבים של 8 המקטעים (מעבר רך ונעים) */
    --bg-1: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%); /* Slate נקי */
    --bg-2: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%); /* קרח עדין */
    --bg-3: linear-gradient(135deg, #e2e8f0 0%, #dbeafe 100%); /* כחול שמים בהיר מאוד */
    --bg-4: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%); /* תכלת עמוק יותר */
    --bg-5: linear-gradient(135deg, #e0f2fe 0%, #e0faf2 100%); /* מעבר עדין למנטה ירקרק */
    --bg-6: linear-gradient(135deg, #e0faf2 0%, #f0fdf4 100%); /* ירוק מנטה פסטל */
    --bg-7: linear-gradient(135deg, #f0fdf4 0%, #fef9c3 100%); /* מעבר רך לצהוב-חול חם */
    --bg-8: linear-gradient(135deg, #fef9c3 0%, #fef2f2 100%); /* סיום ורדרד-אפרסק חמים */
    --bg-9: linear-gradient(135deg, #e2e8f0 0%, #edf2f7 100%);

}
html {
    overflow-x: hidden;
    max-width: 100%;
}
body {
    font-family: 'Assistant', sans-serif;
    color: #1e293b;
    overflow-x: hidden;
    max-width: 100%;
    scroll-behavior: smooth;
}


/* מניעת הסתרת כותרות המקטעים על ידי סרגל הניווט הצף בזמן גלילה */
.portfolio-section {
    scroll-margin-top: 80px;
}

/* עיצוב בר התקדמות גלילה עליון */
#scroll-progress {
    position: fixed;
    top: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    width: 0%;
    z-index: 1060; /* מעל ה-Navbar */
    transition: width 0.1s ease-out;
}

/* עיצוב סרגל הניווט העליון המודרני בסגנון זכוכית */
.custom-navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    z-index: 1040;
}

    .custom-navbar .nav-link {
        color: #475569;
        font-weight: 600;
        padding: 0.5rem 1.1rem !important;
        border-radius: 20px;
        transition: all 0.2s ease;
        font-size: x-small;
    }

        .custom-navbar .nav-link:hover {
            color: var(--accent-color);
            background: rgba(37, 99, 235, 0.05);
        }

        .custom-navbar .nav-link.active {
            color: dodgerblue !important;
            background-color: var(--accent-color);
        }

/* עיצוב כללי למקטעים */
.portfolio-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 80px 0;
    position: relative;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

/* החלת צבעי הרקע על המקטעים */
#section-0 {
    background: var(--bg-1);
}

#section-1 {
    background: var(--bg-2);
}
#section-2 {
    background: var(--bg-3);
}

#section-3 {
    background: var(--bg-4);
}

#section-4 {
    background: var(--bg-5);
}

#section-5 {
    background: var(--bg-6);
}

#section-6 {
    background: var(--bg-7);
}

#section-7 {
    background: var(--bg-8);
}

#section-8 {
    background: var(--bg-9);
}

#section-9 {
    background: var(--bg-1);
}

#section-10 {
    background: var(--bg-2);
}
#section-11 {
    background: var(--bg-3);
}
#section-12 {
    background: var(--bg-4);
}
#section-13 {
    background: var(--bg-5);
}
/* כותרות מעוצבות */
.section-title {
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

    .section-title::after {
        content: '';
        position: absolute;
        bottom: -8px;
        right: 0;
        width: 60px;
        height: 4px;
        background-color: var(--accent-color);
        border-radius: 2px;
    }

.lead-text {
    font-size: 1.25rem;
    line-height: 1.8;
    font-weight: 400;
    color: #475569;
}

/* עיצוב תמונות עם צל עשיר ופינות מעוגלות */
.portfolio-img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease;
}

    .portfolio-img:hover {
        transform: translateY(-5px);
    }

/* תפריט ניווט צף בצד המסך - קומפקטי ומותאם */
.dots-nav {
    position: fixed;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 6px; /* מרווח קטן יותר בין הנקודות */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px 6px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* עיצוב עיגולי האייקונים - מוקטנים */
.dot-link {
    width: 22px; /* הוקטן מ-28px */
    height: 22px; /* הוקטן מ-28px */
    border-radius: 50%;
    background-color: transparent;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem; /* גודל האייקון הוקטן מ-0.85rem */
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

    /* הדגשה בזמן ריחוף עכבר או כשהמקטע פעיל */
    .dot-link:hover,
    .dot-link.active {
        background-color: var(--accent-color, #2563eb);
        color: #ffffff;
        transform: scale(1.15);
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    }

    /* בועת טקסט (Tooltip) קטנה */
    .dot-link::before {
        content: attr(data-title);
        position: absolute;
        left: 30px;
        top: 50%;
        transform: translateY(-50%) scale(0.8);
        background: #0f172a;
        color: #ffffff;
        padding: 3px 8px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
        white-space: nowrap;
        transition: all 0.2s ease;
        opacity: 0;
        pointer-events: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .dot-link:hover::before {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }

/* הסתרת התפריט הצדדי במסכים קטנים (סמארטפונים וטאבלטים אנכיים) */
@media (max-width: 991px) {
    .dots-nav {
        display: none !important;
    }
}
/* כפתור "קדיחה" אינטראקטיבי חגיגי */
.drill-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #ea580c;
    color: white;
    border: none;
    box-shadow: 0 10px 15px -3px rgba(234, 88, 12, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .drill-btn:hover {
        transform: scale(1.1) rotate(15deg);
        background-color: #dd4f05;
    }

/* כפתור גלילה מטה במקטע הראשון */
.scroll-down-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    color: #64748b;
    font-size: 1.5rem;
    text-decoration: none;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-10px) translateX(-50%);
    }

    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

/* עיצוב גרפים של עמוד האנליטיקס */
.trend-bar {
    width: 25px;
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
    margin: 0 auto;
}

/* התאמה למכשירים ניידים */
@media (max-width: 768px) {
    .portfolio-section {
        padding: 60px 0;
        text-align: center;
    }

    .section-title::after {
        right: 50%;
        transform: translateX(50%);
    }

    .dots-nav {
        display: none; /* נעלים את הנקודות הצדדיות בנייד כדי לא להפריע למסך */
    }

    .portfolio-img {
        margin-top: 2rem;
    }

    .drill-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}


/* --- סרגל ניווט במבנה אקורדיון אופקי מלא --- */
.custom-accordion-navbar {
    z-index: 1040;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.accordion-nav-container {
    display: flex;
    width: 100%;
    height: 48px; /* גובה הסרגל העליון */
    overflow: hidden;
    background: #ffffff;
}

/* כל בלוק/לשונית בודדת בסרגל */
.accordion-item {
    flex: 1; /* כולם מתחלקים בשווה */
    min-width: 28px; /* מבטיח שכל לשונית סגורה תהיה רחבה מספיק ברוחב */
    height: 100%;
    position: relative;
    transition: flex 0.4s cubic-bezier(0.25, 1, 0.5, 1), filter 0.3s ease;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* הלינק המקיף בתוך הלשונית */
.accordion-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: #334155;
    padding: 0 10px;
    white-space: nowrap;
}

/* הטקסט של הלשונית */
.accordion-title {
    font-weight: 700;
    font-size: 0.85rem;
    opacity: 0; /* מוסתר כשהלשונית סגורה */
    transform: translateY(5px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* --- הצבעים מתוך הגדרות ה-CSS שלך --- */
.item-1 {
    background: var(--bg-1);
}

.item-2 {
    background: var(--bg-2);
}

.item-3 {
    background: var(--bg-3);
}

.item-4 {
    background: var(--bg-4);
}

.item-5 {
    background: var(--bg-5);
}

.item-6 {
    background: var(--bg-6);
}

.item-7 {
    background: var(--bg-7);
}

.item-8 {
    background: var(--bg-8);
}

.item-9 {
    background: var(--bg-9);
}

.item-10 {
    background: var(--bg-1);
}

.item-11 {
    background: var(--bg-2);
}

.item-12 {
    background: var(--bg-3);
}

.item-13 {
    background: var(--bg-4);
}


/* --- 1. ברירת מחדל: הלשונית הראשונה פתוחה --- */
.accordion-nav-container:not(:hover) .item-1 {
    flex: 4;
    filter: brightness(0.97);
}

    .accordion-nav-container:not(:hover) .item-1 .accordion-title {
        opacity: 1;
        transform: translateY(0);
    }


/* --- 2. התנהגות בזמן ריחוף עכבר (Hover) --- */

/* כאשר נכנסים עם העכבר למכולה - מקטינים את הבלוקים האחרים */
.accordion-nav-container:hover .accordion-item {
    flex: 1;
}

/* הלשונית הספציפית שמרחפים עליה נפתחת */
.accordion-nav-container .accordion-item:hover {
    flex: 5; /* נפתחת לרוחב מלא וקריא */
    filter: brightness(0.97);
}

/* הצגת הטקסט בבלוק המרוחף */
.accordion-item:hover .accordion-title {
    opacity: 1;
    transform: translateY(0);
}

/* התאמה למסכים קטנים (מובייל) */
@media (max-width: 992px) {
    .accordion-nav-container {
        overflow-x: auto;
        /* ✨ הסתרת פס הגלילה כדי לשמור על עיצוב נקי במובייל */
        scrollbar-width: none; /* לפיירפוקס */
        -ms-overflow-style: none; /* לאדג' */
    }
        /* הסתרת פס הגלילה בכרום וספארי */
        .accordion-nav-container::-webkit-scrollbar {
            display: none;
        }

    .accordion-item {
        min-width: 35px;
    }
}

/* --- תוספת עבור מקטע 1: גריד וגלילת פרשיות --- */

/* תיבת גלילה פנימית */
.parasha-scroll-container {
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-left: 5px;
    padding-right: 5px;
}

/* גריד של 2 עמודות לקישורי ה-PDF */
.parasha-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* עיצוב פריט פרשה בודד */
.parasha-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: rgba(248, 249, 250, 0.75);
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

    .parasha-item:hover {
        background-color: rgba(230, 235, 245, 0.9);
        transform: translateY(-1px);
    }

/* התאמת הגריד למסכים צרים מאוד (ניידים) */
@media (max-width: 400px) {
    .parasha-grid {
        grid-template-columns: repeat(1, 1fr); /* שורה אחת בסלולר */
    }
}

/* יישור ועיצוב האייקון באקורדיון הניווט */
.accordion-link i.accordion-icon {
    font-size: 1rem;
    color: #1e293b;
    display: inline-block;
    transition: transform 0.2s ease;
}

/* הגדלת האייקון מעט בריחוף עכבר */
.accordion-item:hover .accordion-icon {
    transform: scale(1.15);
    color: #2563eb;
}

/* --- עיצוב מעבר אייקון/טקסט באקורדיון --- */

/* מיקום בסיסי של הלינק */
.accordion-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* האייקון - מוצג כשהלשונית סגורה */
.accordion-icon {
    position: absolute;
    font-size: 1.1rem;
    color: #475569;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* הטקסט - מוסתר כשהלשונית סגורה */
.accordion-title {
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* --- התנהגות כשהלשונית נפתחת (Hover) --- */

/* מעלימים את האייקון בלשונית שמערפלים עליה */
.accordion-nav-container .accordion-item:hover .accordion-icon {
    opacity: 0;
    transform: scale(0.5);
}

/* מציגים את הטקסט בלשונית שמערפלים עליה */
.accordion-nav-container .accordion-item:hover .accordion-title {
    opacity: 1;
}

/* --- התנהגות ברירת המחדל (כשאין Hover - הלשונית הראשונה "בית" פתוחה) --- */

.accordion-nav-container:not(:hover) .item-1 .accordion-icon {
    opacity: 0;
    transform: scale(0.5);
}

.accordion-nav-container:not(:hover) .item-1 .accordion-title {
    opacity: 1;
}


/* מדבקת מחיר לספרים */
.price-sticker {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); /* מעבר צבעים אדום חי */
    color: #ffffff;
    width: 65px;
    height: 65px;
    border-radius: 50%; /* הופך את המדבקה לעיגול מושלם */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4), inset 0 -2px 4px rgba(0,0,0,0.1); /* צל חיצוני וצל פנימי לתלת-ממד */
    z-index: 10; /* מוודא שהמדבקה תהיה מעל התמונה */
    transform: rotate(15deg); /* זווית נטויה שמדמה הדבקה ידנית */
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none; /* מאפשר ללחוץ על התמונה שמתחת למדבקה */
}

/* אפקט ריחוף (אופציונלי - אם תבטל את ה-pointer-events) */
.card:hover .price-sticker {
    transform: scale(1.1) rotate(0deg);
}

.price-sticker .currency {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 2px;
}