/*
Theme Name: My Custom Theme
Author: Your Name
Description: My first permanent sandbox theme.
Version: 1.0
*/

body {
    margin: 0;
    font-family: 'David Libre', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;

    direction: rtl;
    unicode-bidi: embed;
    text-align: right; /* This ensures all your text starts on the right side */
}

.header-container {
    flex-direction: row-reverse; /* This flips the logo and menu positions */
    display: flex;
    justify-content: space-between; /* הלוגו בצד אחד, התפריט בצד שני */
    align-items: center;
    flex-wrap: wrap; /* מאפשר לתפריט לרדת שורה אם אין מקום */
    padding: 10px 20px;
}

/* הגדרות לוגו כלליות */
.site-logo {
    display: block;
    height: auto !important;
    max-height: 70px !important; /* ה-important מוודא ששום דבר לא ידרוס את זה */
    width: auto !important;
    vertical-align: middle; /* ליתר ביטחון */
}

.hero-section {
    height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
background: linear-gradient(
        to left, 
        #ffadad, 
        #ffd6a5, 
        #fdffb6, 
        #caffbf, 
        #9bf6ff, 
        #bdb2ff
    ) !important;    color: black;
}

.hero-section h1 {
    font-size: 4rem;
    margin-bottom: 10px;
}

.cta-button {
    background-color: #ffffff;
    color: #6e8efb;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    margin-top: 20px;
    transition: transform 0.2s;
}

.cta-button:hover {
    transform: scale(1.1);
}
/* מיכל המטרות - הגדרת רשת של זוגות */
.features-grid {
    display: flex;    /* יוצר 2 טורים שווים */
    grid-template-columns: repeat(2, 1fr); 
    gap: 30px; /* רווח גדול יותר בין הכרטיסים למראה מאוורר */
    padding: 40px 5%;
    max-width: 1100px; /* רווח אופטימלי ל-2 כרטיסים בשורה */
    margin: 0 auto;
    direction: rtl;
    justify-content: center;
}

/* הכרטיסייה הבודדת */
.feature-card {
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 15px;
    text-align: center;
    background: #fff; /* וודא שיש רקע לבן */
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center; /* מיישר את התוכן למרכז הגובה של הכרטיס */
}

/* אפקט ריחוף משודרג */
.feature-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transform: translateY(-5px); /* קפיצה קטנה למעלה שנותנת תחושת חיות */
}

/* כותרת המטרה */
.feature-card h3 {
    color: #6e8efb;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

/* טקסט המטרה */
.feature-card p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* תיקון קריטי למובייל - חזרה לטור אחד כדי שלא יהיה צפוף */
@media (max-width: 768px) {
    /* הופך את הגריד לטור אחד ארוך */
    .features-grid {
        display: grid !important;
        grid-template-columns: 1fr !important; /* כרטיס אחד בכל שורה */
        gap: 20px !important; /* רווח בין הכרטיסים */
        width: 100% !important;
        padding: 10px 20px !important;
        box-sizing: border-box !important;
    }

    /* מוודא שהכרטיסים עצמם לא בורחים מהצדדים */
    .features-grid > div { 
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 auto !important;
        display: block !important; /* מחזיר אותם להתנהגות של בלוק */
    }

    /* אם יש תמונות בתוך הכרטיסים שיוצאות משליטה */
    .features-grid img {
        max-width: 100% !important;
        height: auto !important;
    }
}

.site-footer {
    background-color: #333;
    color: #fff;
    padding: 40px 0;
    margin-top: 50px;
    text-align: center;
}

.footer-content p {
    margin-bottom: 15px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer-links a {
    color: white;
    margin: 0 10px;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

.main-header {
    background-color: #ffffff;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #6e8efb;
    text-decoration: none;
}

.main-nav ul {
    display: flex;
    align-items: center; /* זה המרכז האנכי של פריטי התפריט */
    list-style: none;
    gap: 20px;
    margin: 0;
}



/* במובייל - שהתפריט יהיה במרכז ומתחת ללוגו */
@media (max-width: 768px) {
    /* 1. הופך רק את המיכל של ההדר לשתי קומות */
    header.main-header .header-container {
        display: flex !important;
        flex-wrap: wrap !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 15px 20px !important;
    }

    /* 2. מטפל רק ב-A של הלוגו בתוך ההדר */
    header.main-header .logo-link {
        order: 1 !important;
        flex: 0 0 auto !important;
    }

    /* 3. מטפל רק בכותרת ה-logo שבתוך ההדר (השם של האיגוד) */
    /* זה ימנע מהכותרת הגדולה באמצע עמוד הבית להשתבש */
    header.main-header a.logo {
        order: 2 !important;
        flex: 0 0 auto !important;
        font-family: 'David Libre', serif !important;
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: #6e8efb !important;
        text-decoration: none !important;
        margin: 0 !important;
        border: none !important;
    }

    /* 4. שורת התפריט - רק בתוך הניווט של ההדר */
    header.main-header .main-nav {
        order: 3 !important;
        width: 100% !important;
        margin-top: 15px !important;
        border-top: 1px solid #eee;
        padding-top: 10px !important;
    }

    /* 5. ניקוי הקישורים העלובים - רק בתוך ההדר */
    header.main-header .main-nav ul {
        display: flex !important;
        justify-content: center !important;
        gap: 25px !important;
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    header.main-header .main-nav ul li a {
        font-family: 'David Libre', serif !important;
        font-size: 1rem !important;
        color: #444 !important;
        text-decoration: none !important;
        border: none !important;
    }
}

.main-nav li {
    margin-left: 30px;
    vertical-align: middle; /* ליתר ביטחון */
    align-items: center; /* זה המרכז האנכי של פריטי התפריט */
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: #6e8efb;
}

.sub-page {
    max-width: 900px;
    margin: 50px auto;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    min-height: 60vh;
}

.sub-page h1 {
    color: #6e8efb;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}

.sub-page-header {
background: linear-gradient(
        to left, 
        #ffadad, 
        #ffd6a5, 
        #fdffb6, 
        #caffbf, 
        #9bf6ff, 
        #bdb2ff
    ) !important;    color: black;
    padding: 60px 20px;
    text-align: center;
    direction: rtl;
}

.jobs-container {
    max-width: 1000px;
    margin: -40px auto 50px; /* Pulls the list up into the header slightly */
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    direction: rtl;
}

.job-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.job-row:hover {
    background-color: #fcfcfc;
}

.job-info h3 {
    margin: 0;
    color: #333;
}

.location {
    color: #666;
    font-size: 0.9rem;
}

.job-type {
    background: #eef2ff;
    color: #6e8efb;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-left: 15px;
}

.apply-btn {
    text-decoration: none;
    color: #6e8efb;
    font-weight: bold;
    border: 1px solid #6e8efb;
    padding: 8px 20px;
    border-radius: 5px;
}

/* Apply this to the whole site structure */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Makes the body at least the height of the screen */
    margin: 0;
}

main, .container {
    flex: 1; /* This pushes the footer down by taking up all available space */
}

.site-footer {
    background-color: #333;
    color: #fff;
    padding: 40px 0;
    text-align: center;
    width: 100%;
}

.municipalities-container {
    padding: 40px 2%;
    direction: rtl;
}

.table-responsive {
    background: transparent !important; /* מבטל את הרקע הלבן שנמרח */
    box-shadow: none !important;
    padding: 0 !important;
    width: auto !important;
    display: block;
}

.muni-table {
width: auto !important;           /* כאן היה ה-100% הבעייתי - ביטלנו */
    border-collapse: collapse;
    text-align: right;
    font-size: 1rem;
    margin: 0 auto !important;
    table-layout: auto !important;    /* מאפשר צמצום לפי תוכן */
}

.muni-table th {
    background-color: #f8f9fa;
    color: #6e8efb;
    padding: 15px;
    border-bottom: 2px solid #eee;
    font-weight: bold;
}

.muni-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
}

.muni-table tr:hover {
    background-color: #fcfaff; /* אפקט מעבר עכבר על שורה */
}

.muni-table a {
    color: #6e8efb;
    text-decoration: none;
}

.muni-table a:hover {
    text-decoration: underline;
}

/* התאמה למובייל - מקטין מעט את הטקסט */
@media (max-width: 600px) {
    .muni-table {
        font-size: 0.85rem;
    }
}

.muni-table {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none;      /* IE 10+ */
    user-select: none;         /* Standard syntax */
}

/* גריד הכרטיסים */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

/* עיצוב הכרטיס - דומה למטרות בעמוד הראשי */
.tool-card {
    background: #ffffff;
    border-radius: 15px;
    padding: 35px; /* מרווח פנימי גדול ונוח */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: center;
    border: 1px solid #f0f0f0;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.tool-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.tool-card h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 15px;
}

.tool-card p {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 25px;
    flex-grow: 1; /* דוחף את הכפתורים לתחתית הכרטיס */
}

/* שדה הקלט והכפתורים בתוך הכרטיס */
.scraper-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#event-url {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
}

.btn-primary, .btn-secondary, .btn-success {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.2s;
    cursor: pointer;
}

.btn-primary { background: #6e8efb; color: #fff; border: none; }
.btn-secondary { border: 2px solid #6e8efb; color: #6e8efb; background: transparent; }
.btn-success { background: #28a745; color: #fff; border: none; margin-top: 15px; }

/* אזור התצוגה המקדימה בתוך הכרטיס */
.preview-box {
    margin-top: 20px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    border: 1px dashed #ccc;
}

/* הגדרה גורפת שכל מרכיבי הטפסים יירשו את הגופן של האתר */
input, 
button, 
select, 
textarea {
    font-family: 'David Libre', serif !important;
}

/* עדכון ספציפי לשדה הלינק והכפתורים בדף הכלים */
#event-url, 
.btn-primary, 
.btn-secondary, 
.btn-success {
    font-family: 'David Libre', serif;
}

/* רקע כהה שקוף */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

/* קופסת התוכן של המודאל */
/* קופסת התוכן של המודאל - מעודכן */
.modal-content {
    background: #ffffff;
    width: 90%;            /* רוחב גמיש למובייל */
    max-width: 550px;      /* רוחב מקסימלי נוח */
    max-height: 85vh;      /* גובה מקסימלי - 85% מגובה המסך */
    border-radius: 15px;
    padding: 30px;
    position: relative;
    text-align: right;
    
    /* הפתרון לחריגה מהמסך: */
    overflow-y: auto;      /* מאפשר גלילה פנימית אם התוכן ארוך */
    display: flex;
    flex-direction: column;
    
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    animation: scaleIn 0.3s ease;
}

/* עיצוב פס הגלילה הפנימי (אופציונלי - למראה נקי יותר) */
.modal-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 10px;
}

/* התאמה למובייל */
@media (max-width: 600px) {
    .modal-content {
        padding: 20px;
        max-height: 90vh;
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    left: 15px; /* בצד שמאל כי האתר בעברית */
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
    padding: 10px; /* שטח לחיצה גדול יותר */
}

.close-modal:hover {
    color: #333;
}

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-group input, .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-family: 'David Libre', serif; }

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* הגדרה משותפת לשתי התיבות הלבנות */
.communities-container,.muni-table{ 
    display: block !important;        /* מחזיר אותם להתנהגות של שורות נפרדות */
    width: fit-content !important;    /* גורם לתיבה להתכווץ לרוחב הטבלה */
    margin: 40px auto !important;     /* יוצר רווח גדול (40px) בין התיבות וממרכז אותן */
    
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    box-sizing: border-box;
    clear: both;                      /* מבטיח שאף אלמנט לא "נדבק" אליהם מהצד */
}


.header-auth {
    display: flex;
    align-items: center;
    gap: 15px;
}

.auth-btn {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.auth-btn.login {
    border: 1px solid #6e8efb;
    color: #6e8efb;
}

.auth-btn.login:hover {
    background: #6e8efb;
    color: white;
}

.auth-btn.logout {
    color: #ff4d4d;
    font-size: 0.8rem;
}

.welcome-msg {
    font-size: 0.9rem;
    color: #666;
}

/* מבטיח שהקונטיינר הראשי פורש את האיברים לצדדים */
.header-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-direction: row-reverse; /* שומר על כיוון ה-RTL של האתר שלך */
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1; /* מאפשר לקבוצה הזו לתפוס מקום ולדחוף */
}

/* הצמדת הלוגו לימין הקיצוני בתוך הקבוצה שלו */
.logo-link {
    margin-left: 0; /* מוודא שאין מרווח מימין */
}

/* הצמדת שם האיגוד לשמאל בתוך הקבוצה (אם תרצה שהתפריט יהיה במרכז האתר) */
.logo {
    margin-right: auto; /* זה ה"טריק" שדוחף את הטקסט שמאלה ומשאיר את הלוגו בימין */
    font-weight: bold;
    text-decoration: none;
    color: #6e8efb;
}

.main-nav {
    flex: 2; /* נותן לתפריט יותר מרחב להתמרכז */
    flex-grow: 1;
    display: flex;
    justify-content: center; /* מרכז את התפריט בין הלוגו לכפתור */
    vertical-align: middle; /* ליתר ביטחון */
}

/* עיצוב הכפתור כדי שייראה חלק מהתפריט */
.header-auth {
    margin-right: 20px; /* רווח מהתפריט */
}

.auth-btn.login {
    background: transparent;
    border: 1px solid #6e8efb;
    color: #6e8efb !important;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap; /* מונע מהטקסט לרדת שורה */
}

.auth-btn.login:hover {
    background: #6e8efb;
    color: white !important;
}

.lock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8); /* רקע חצי שקוף */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.lock-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    text-align: center;
    max-width: 600px;
    width: 90%;
}

.lock-icon { font-size: 50px; margin-bottom: 15px; }

.lock-actions {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.action-box {
    flex: 1;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.action-box h4 { font-size: 16px; margin-bottom: 15px; min-height: 40px; }

.btn-lock {
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.btn-lock.primary { background: #0073aa; color: white; }
.btn-lock.secondary { background: #e1e8ed; color: #333; }
.btn-lock:hover { opacity: 0.8; transform: translateY(-2px); }

/* התאמה לנייד */
@media (max-width: 600px) {
    .lock-actions { flex-direction: column; }
}

/* התאמות ספציפיות לכפתורים בתוך ה-Overlay */
.lock-content .btn-primary, 
.lock-content .btn-secondary {
    display: block;
    text-align: center;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* אם אין לך עדיין הגדרת Hover כללית, זה יוסיף אפקט נעים */
.lock-content .btn-primary:hover, 
.lock-content .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.action-box {
    flex: 1;
    background: #fdfdfd; /* צבע רקע עדין לקופסה */
    padding: 25px;
    border: 1px solid #f0f0f0;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* הגדרות כלליות לתגיות מחוז */
/* הגדרות בסיסיות לתגית המחוז */
.district-tag {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white; /* טקסט לבן לניגודיות */
    background: #eee; /* צבע ברירת מחדל */
}

/* צבעים לפי מחוז */
.dist-צפון .district-tag { background-color: #27ae60 !important; } /* ירוק */
.dist-מרכז .district-tag { background-color: #2980b9 !important; } /* כחול */
.dist-דרום .district-tag { background-color: #e67e22 !important; } /* כתום */

/* אם יש מחוזות נוספים, אפשר להוסיף אותם כאן באותו מבנה */

/* עיצוב הכרטיס */
.muni-card {
    border: 1px solid #eee;
    border-radius: 15px;
    transition: 0.3s ease;
    text-align: center;
    overflow: hidden;
}
.muni-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
/* הגדרת בסיס ל-Header */
.muni-card-header {
    padding: 20px 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* צביעת ה-Header לפי סדר הכרטיסיות */
.muni-card:nth-child(6n+1) .muni-card-header { background-color: #ffadad !important; }
.muni-card:nth-child(6n+2) .muni-card-header { background-color: #ffd6a5 !important; }
.muni-card:nth-child(6n+3) .muni-card-header { background-color: #fdffb6 !important; }
.muni-card:nth-child(6n+4) .muni-card-header { background-color: #caffbf !important; }
.muni-card:nth-child(6n+5) .muni-card-header { background-color: #9bf6ff !important; }
.muni-card:nth-child(6n+6) .muni-card-header { background-color: #bdb2ff !important; }

.muni-card-body { padding: 20px; }
.muni-role { font-size: 14px; color: #888; margin-bottom: 5px; }
.muni-name { font-size: 18px; margin-bottom: 15px; display: block; }
.muni-social-links a { margin: 0 8px; font-size: 20px; color: #555; }
.muni-social-links a:hover { color: #0073aa; }

.muni-social-links img {
    transition: all 0.3s ease;
    filter: grayscale(100%) opacity(0.6); /* מתחיל באפור */
}

.muni-social-links a:hover img {
    filter: none; /* חוזר לצבע המקורי ב-hover */
    opacity: 1;
    transform: scale(1.1);
}

.flatpickr-calendar { z-index: 99999 !important; }