/* =========================================
   בסיס
   ========================================= */
:root {
    /* שינוי לסכמת שחור-לבן נקייה */
    --bg-gradient: #eee; 
    --widget-bg-rgba: rgba(255, 255, 255, 0.9);
    --widget-bg-base: #ffffff;
    --link-color: #000000;
    --accent-purple: #333333;
    --primary-blue: #000000;
    --card-border: #ddd;
    --transition-speed: 0.3s;
}

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    background-size: cover;
    margin: 0;
    padding: 0;
    font-family: 'Assistant', sans-serif;
    transition: background 0.5s ease;
    min-height: 100vh;
}

a {
    color: var(--link-color);
    text-decoration: none;
}

/* =========================================
   מבנה 
   ========================================= */
.page-wrapper {
    /* המעטפת ששומרת שהכל יהיה באמצע */
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.workspace {
    /* מרחב העבודה שבו הכל קורה */
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
    margin: 5px 0;
    align-items: flex-start;
    flex-wrap: wrap;
}

.column {
    /* העמודות שמחזיקות את הכל  */
    flex: 1 1 240px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 350px;
    min-width: 0;
}


.column.drag-over {
    background-color: rgba(108, 92, 231, 0.05);
    outline: 2px dashed var(--accent-purple);
    outline-offset: -5px;
}



/* =========================================
   3. החלק העליון - לוגו וחיפוש
   ========================================= */
.hero {
    padding-top: 20px;
    text-align: center;
}

.logo {
    display: block;
    margin-bottom: 40px;
}

.logo-img {
    max-width: 260px;
    height: auto;
}


.hero-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-actions button {
    position: relative; /* חובה כדי שהבועה תתמקם ביחס לכפתור */
    background-color: var(--widget-bg-rgba) !important;
    color: var(--link-color) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    padding: 4px 6px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    gap: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

/* עיצוב הבועה האדומה */
.notification-badge {
    position: absolute;
    top: -2px; /* מעט מעל גבול הכפתור */
    right: -2px; /* מעט מחוץ לגבול הכפתור */
    width: 12px;
    height: 12px;
    background-color: #ff4b2b; /* אדום חי */
    border: 2px solid #fff; /* מסגרת לבנה שתפריד מהכפתור השקוף */
    border-radius: 50%;
    display: none; /* מוסתר כברירת מחדל */
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 20;
}

/* הצגה כשיש הודעה */
.has-new-messages .notification-badge {
    display: block;
}


.hero-actions button:hover {
    filter: brightness(0.9);
    transform: translateY(-2px);
}


.search-bar{
margin-bottom: 20px;
}




/* =========================================
   הווידג'טים 
   ========================================= */


.widget-card {
    /* שימוש ישיר במשתנה ה-RGBA שנוצר ב-JS */
    background-color: var(--widget-bg-rgba) !important; 
    border-radius: 14px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.05);
    width: 100%;
    transition: max-height 0.4s ease, transform 0.2s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.widget-card.collapsed {
    max-height: 48px; /* גובה כותרת בלבד */
}

.widget-title {
    font-weight: 800;
    color: var(--link-color) !important;
    padding: 12px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 18px;
    background: transparent;
    user-select: none;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    flex-shrink: 0;
}

/* תיקון הגלילה כאן */
.widget-content {
    overflow-y: auto; /* הוספת נקודה-פסיק שחסרה */
    max-height: 300px; /* הגבלת גובה פנימי ליצירת גלילה */
    padding: 10px;
    display: block;
}

/* עיצוב פס גלילה דק ויפה */
.widget-content::-webkit-scrollbar {
    width: 8px;
}
.widget-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}
.widget-content::-webkit-scrollbar-thumb:hover {
    background: var(--link-color);
}

.widget-card.collapsed .widget-content {
    display: none;
}


.widget-title .chevron {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    height: auto !important;
    width: auto !important;
}


/* רשימת הקישורים המסודרת - עברנו ל-3 טורים! */
.link-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px 2px;
}

.link-item-container {
    background-color: var(--link-bg-rgba, transparent);
    color: var(--link-color, #333);
   border-radius: 12px;
    position: relative; 
}


.link-item-container a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 12px;
    padding: 6px 2px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-blue);
    transition: 0.2s ease;
    min-height: 80px;
}

.link-item-container a:hover {
    background: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.06);
}

.favicon-img {
    /* האייקון הקטן של האתר */
    width: 42px;
    height: 42px;
    object-fit: contain;
    margin-bottom: 6px;
}



.add-to-dock-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 5;
    background: transparent;
    border: none;
    color: var(--primary-blue) !important;
    font-size: 18px; 
    font-weight: 900; 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    box-shadow: none;
    opacity: 0; 
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* הופעת הכפתור כשעוברים עם העכבר על כל אזור הקישור */
.link-item-container:hover .add-to-dock-btn {
    opacity: 1;
}

/* אפקט כשעוברים עם העכבר ספציפית על החץ עצמו */
.add-to-dock-btn:hover {
    transform: scale(1.3);
    color: var(--accent-purple) !important;
    filter: drop-shadow(0 3px 4px rgba(0,0,0,0.15));
}




/* =========================================
   המעגן (Quick Dock)
   ========================================= */
#quickDock, .quick-dock {
    width: 100%;
    max-width: 980px;
    min-height: 80px;
    margin: 10px auto 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px;
    position: relative;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
}

#quickDock:empty::before {
    content: "גרור לכאן קישורים או הדבק (Ctrl+V)";
    color: rgba(10, 10, 10, 0.9);
    font-size: 15px;
}

.dock-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 78px;
    height: 78px;
    border-radius: 14px;
    background: #fff; 
    box-shadow: 
    inset 0px 0px 6px 0px rgba(0,0,0,0.4), 0px 4px 4px rgba(0,0,0,0.9);   
    transition: 0.2s ease;
    cursor: grab;
}


.dock-item:hover {
  box-shadow: inset 0px 0px 3px 0px rgba(0,0,0,0.6), 0px 4px 8px rgba(0,0,0,0.6);  
  transform: scale(104%);
  animation: movingBorders 3s infinite;
  text-decoration: none;
}


.dock-favicon {
    width: 38px;
    height: 38px;
    object-fit: contain;
}


.dock-text {
    /* הטקסט הקטן מתחת לאייקון */
    font-size: 14px;
    font-weight: 650;
    color: #2c3e50 !important;
    text-align: center;
    margin-top: 4px;
    max-width: 86%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}



/* הכפתור האדום למקרה שרוצים להיפרד מקישור */
.remove-dock-item {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 20px;
    height: 20px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 10;
}

.dock-item:hover .remove-dock-item {
    opacity: 1;
}

/* =========================================
   WOPA 2026 - Modal & System UI Styles
   ========================================= */
/* רקע המודאל */
#modalOverlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    display: none; justify-content: center; align-items: center; z-index: 9999;
 z-index: 10000 !important; 
}
#modalOverlay.active { display: flex; }

/* תיבת התוכן - הגדרות בסיס */
#modalContent {
    background: #fff; border-radius: 12px; position: relative; overflow: hidden;
    display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

/* הגדרת מידות קשיחות לפי סוג */
#modalContent.medium { width: 450px; height: 550px; }
#modalContent.large  { width: 90vw; height: 85vh; }
#modalContent.settings { width: 500px; min-height: 450px; }

/* ה-Iframe חייב למלא את כל המרחב */
#modalIframe { flex: 1; width: 100%; height: 100%; border: none; display: block; }

/* כפתור סגירה */
.close-modal {
    position: absolute; top: 10px; right: 10px; width: 26px; height: 26px;
    background: #f0f0f0; border-radius: 50%; display: flex; align-items: center; 
    justify-content: center; cursor: pointer; z-index: 100; font-family: sans-serif;
}
.close-modal:hover { background: #ff4d4d; color: #fff; }

/* הסתרת הגדרות כשהן לא בשימוש */
#settingsContainer { display: none; padding: 20px; flex: 1; overflow-y: auto; }



/* =============================================================
   STYLE.CSS - ניהול אווירה ורקע (Ambient & Background)
   ============================================================= */

/* 1. הקונטיינר הראשי של הרקע (תמונות או וידאו) */
#ambient-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2; /* הכי מאחור */
    overflow: hidden; /* שומר שהחלקים החורגים של הנגן לא יצרו גלילה */
    pointer-events: none;
    opacity: 1; /* ביטלנו את ה-0 כדי שהוידאו יעלה מיידית ללא עיכוב */
}

/* 2. הנגן של יוטיוב - שיטת ה"קרופינג" להסתרת הפלייר */
#ambient-container iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    /* מתיחה של 110% כדי להוציא את לוגו יוטיוב והכפתורים מחוץ לפריים */
    width: 110vw; 
    height: 62vw; /* שומר על יחס 16:9 מוגדל בהתאמה */
    min-height: 110vh;
    min-width: 195vh;
    transform: translate(-50%, -50%);
}

/* 3. שכבת הפילטר (Overlay) - שולטת בצבע וכהות מעל הוידאו */
#ambient-overlay {
    position: fixed;
    inset: 0;
    z-index: -1; /* מעל הוידאו (-2) אבל מתחת לתוכן האתר (10) */
    pointer-events: none; /* מאפשר ללחוץ על האתר "דרכו" */
    transition: background 0.3s ease, opacity 0.3s ease;
}

/* 4. וודא שכל תוכן האתר תמיד מעל הרקעים */
.page-wrapper {
    position: relative;
    z-index: 10;
}


/* =========================================
   8. איך זה נראה בטלפון? (מובייל)
   ========================================= */

/* מובייל - רק למסכים קטנים באמת */
@media (max-width: 580px) {
    .page-wrapper {
        padding: 0 10px;
    }
    .workspace {
        flex-direction: column;
        align-items: center;
    }

    /* ההוספה החדשה לכפתורים העליונים: 4 בטור, 2 שורות */
    .hero-actions {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px; /* ריווח קטן יותר למובייל */
        padding: 0 10px; /* קצת ריווח מהצדדים */
    }

    .hero-actions button {
        margin-bottom: 15px; 
        font-size: 14px; 
        padding: 6px 2px;
    }

    /* ההגדרות האלו חזרו להיות בתוך הבלוק של המובייל */
    .column {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
    .link-list {
        grid-template-columns: repeat(2, 1fr); /* 2 טורים במובייל */
    }
} /* סוף הבלוק של המובייל */


/* מחשב - 3 טורים */
@media (min-width: 769px) {
    .link-list {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* =========================================
   ווידג'טים - תיקון שקיפות טקסט
   ========================================= */
.widget-card {
    /* שימוש ב-RGBA במקום Opacity כללי */
    background-color: var(--widget-bg-rgba) !important;
    border-radius: 14px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.05);
    width: 100%;
    transition: max-height 0.4s ease, transform 0.2s;
    max-height: 1200px;
    cursor: grab;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* הסרנו את opacity: var(--widget-opacity) כדי שהטקסט ישאר אטום */

.widget-title {
    font-weight: 800;
    color: var(--link-color) !important;
    padding: 12px 16px;
    font-size: 17px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

/* =========================================
   עורך גרדיאנט - עיצוב ידיות
   ========================================= */

.slider-container {
    position: relative;
    width: 100%;
    height: 55px;
    background: #eee;
    border-radius: 8px;
    margin: 25px 0 40px 0;
    cursor: crosshair;
    border: 1px solid #ddd;
}

#slider-gradient-bar {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    pointer-events: none;
}

.stop-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 26px;
    background: white;
    border: 1px solid #333;
    border-radius: 4px;
    cursor: grab;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 5;
}

.stop-handle.active {
    border-color: var(--accent-purple);
    border-width: 1px;
    transform: translate(-50%, -50%) scale(1.1);
}

.preset-gallery {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.btn-small {
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
}

/* =========================================
             מודאל 
   ========================================= */

.modal-content {
    position: relative; /* מאפשר ל-X להתמקד ביחס לקופסה */
    padding-top: 40px;   /* שומר מקום ל-X שלא יסתיר את התוכן */
}

.close-modal {
    position: absolute;
    top: 10px;
    left: 15px; /* מעביר את ה-X לצד שמאל */
    right: auto; /* מבטל הצמדה לימין */
    font-size: 28px;
    cursor: pointer;
    color: #999;
    z-index: 1001;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #e74c3c;
}

/* =============================================================
   אנימציית "טיסה" של אייקון למעגן (Fly to Dock)
   ============================================================= */

.fly-to-dock-icon {
    position: fixed;
    z-index: 9999;
    width: 42px;
    height: 42px;
    pointer-events: none;
    transition: all 0.8s cubic-bezier(0.19, 1, 0.22, 1); /* תנועה חלקה ומהירה */
    opacity: 1;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* אפקט הבהוב קטן לקישור המקור בזמן הלחיצה */
.link-item-container.pop-effect {
    animation: link-pop 0.4s ease-out;
}

@keyframes link-pop {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(0.95); filter: brightness(1.5); }
    100% { transform: scale(1); filter: brightness(1); }
}

/* =============================================================
   FLOATING TOOLS STYLES - חלונות צפים
   ============================================================= */
.wopa-floating-tool {
    position: fixed;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #ddd;
    resize: both;
    z-index: 9999;
    font-family: 'Assistant', sans-serif;
    min-width: 200px;
    min-height: 150px;
}

.wopa-tool-header {
    background: #f8f9fa;
    padding: 10px 15px;
    cursor: grab;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 14px;
    color: #2d3436;
    border-bottom: 1px solid #eee;
    user-select: none;
}

.wopa-tool-header:active {
    cursor: grabbing;
}

.wopa-tool-close {
    background: #ff7675;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
}

.wopa-tool-close:hover {
    background: #d63031;
}

.wopa-tool-iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: #fff;
    display: block;
}

/* עיצוב רכיבים בתוך הגדרות צפות */
.wopa-tool-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: white;
}


/* התאמה למובייל - חלון צף לא יחרוג מהמסך */

@media (max-width: 600px) {
    .wopa-floating-tool {
        max-width: 95vw !important;
        max-height: 80vh !important;
    }
} 

#main-ui-container {
    width: 100%; 
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15); 
    border: 1px solid rgba(255, 255, 255, 0.4); 
    padding: 25px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.15); 
    position: relative;
    z-index: 2;
}



/* כפתורי הפעולה (פתח הכל / צור קטגוריה) */
.action-pill {
    background: var(--widget-bg-rgba) !important; /* שואב את צבע הרקע של הווידג'טים */
    color: var(--link-color) !important; /* שואב את צבע הטקסט מהנושא */
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 5px 14px; /* הקטנו את הריווח הפנימי */
    font-size: 13px; /* הקטנו את הכתב */
    border-radius: 14px; /* התאמנו לעיגוליות של שאר הכפתורים */
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: 6px; /* ריווח מדויק בין האייקון לטקסט */
    font-family: 'Assistant', sans-serif;
}

.action-pill:hover {
    transform: translateY(-2px);
    filter: brightness(0.95); /* הבהוב קל בלחיצה */
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* אייקוני ניהול בתוך הקטגוריות */
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.category-tools {
    display: none; 
    gap: 8px;
}

.workspace-category:hover .category-tools {
    display: flex;
}

.cat-tool-btn {
    cursor: pointer;
    font-size: 0.9em;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.cat-tool-btn:hover {
    opacity: 1;
}

.cat-tool-btn.delete:hover {
    color: #ff4d4d;
}

/* =================================================
   ADMIN ICONS - עריכת קטגוריות
   ================================================= */

/* עיצוב חלונות מודל עריכה מנהל (החלק שהיה חסר!) */
.admin-modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); display: none; justify-content: center; align-items: center; z-index: 10000; opacity: 0; transition: opacity 0.2s ease; }
.admin-modal-overlay.show { display: flex; opacity: 1; }
.admin-modal-box { background: #fff; border-radius: 12px; padding: 25px; width: 350px; box-shadow: 0 15px 35px rgba(0,0,0,0.2); transform: translateY(-20px); transition: transform 0.2s ease; direction: rtl; }
.admin-modal-overlay.show .admin-modal-box { transform: translateY(0); }
.admin-modal-input { width: 100%; padding: 10px; margin-bottom: 15px; border: 1px solid #dfe6e9; border-radius: 6px; box-sizing: border-box; font-family: inherit; transition: border-color 0.2s; font-size: 14px; }
.admin-modal-input:focus { border-color: #0984e3; outline: none; }
.admin-modal-btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; transition: 0.2s; }
.admin-modal-btn:hover { filter: brightness(0.95); }

/* מעטפת הכפתורים בהדר */
.admin-header-controls {
    display: flex;
    align-items: center;
    margin-right: auto; 
    margin-left: 10px;
    gap: 8px;
}

/* 1. דחיפת כפתור "ערוך" שמאלה */
.cat-edit-btn {
    background: transparent;
    border: 1px solid var(--link-color);
    color: var(--link-color);
    border-radius: 12px;
    padding: 4px 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'Assistant', sans-serif;
    margin-right: auto !important; 
    margin-left: 15px !important;
}
.cat-edit-btn:hover { background: rgba(0,0,0,0.05); }

/* מסגרת קטגוריה בזמן עריכה */
.widget-card.editing {
    outline: 2px dashed #0984e3;
}

.widget-card.editing .cat-edit-btn {
    background: #0984e3;
    border-color: #0984e3;
    color: white;
}

/* סרגל הכלים הפנימי */
.admin-cat-ctrl {
    display: none !important;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.04);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.05);
}

.widget-card.editing .admin-cat-ctrl {
    display: flex !important;
}

.admin-btn-icon {
    background: none;
    border: none;
    color: var(--link-color);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-btn-icon:hover { transform: scale(1.15); }
.admin-btn-icon.del:hover { color: #e74c3c; } 
.admin-btn-icon.add:hover { color: #27ae60; } 

/* כפתורי מחיקת קישורים */
.add-to-dock-btn.admin-delete-btn {
    display: none !important;
}
.widget-card.editing .add-to-dock-btn.admin-delete-btn {
    display: flex !important;
    opacity: 1;
}


.widget-card.editing .link-item-container a {
    cursor: grab; /* משנה את סמן העכבר ליד תופסת */
}
.widget-card.editing .link-item-container a:active {
    cursor: grabbing; /* יד קפוצה בזמן גרירה */
}


/* 2. מרכוז הקובייה */
.admin-add-cube {
    display: flex !important; 
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: transparent;
    border: 1px dashed rgba(0,0,0,0.15);
    border-radius: 12px;
    min-height: 80px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    color: var(--link-color);
}
.admin-add-cube:hover {
    background: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.06);
}

/* 3. ריחוף דינמי למודאל */
.admin-modal-overlay.floating-mode {
    justify-content: flex-start;
    align-items: flex-start;
}
.admin-modal-box.floating-mode {
    position: absolute;
    transform: none !important; 
    transition: opacity 0.2s ease;
}


#wopa-install-btn {
    background-color: #6c5ce7;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Assistant', sans-serif;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background 0.3s;
    /* ממרכז את האייקון והטקסט */
    align-items: center; 
    gap: 8px;
}

#wopa-install-btn:hover {
    background-color: #5b4bc4;
}


/* --- WOPA Clock Widget --- */
#main-ui-container {
    position: relative; 
}

/* עיצוב רגיל (מחשב) - קובייה בצד ימין */
.wopa-clock {
    position: absolute;
    top: 20px;
    right: 20px;
    left: auto;
    transform: none;
    display: block; 
    background: var(--widget-bg-rgba, rgba(255, 255, 255, 0.9));
    color: var(--link-color, #000);
    padding: 12px 25px;
    border-radius: 18px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    transition: background 0.3s, color 0.3s;
}

.wopa-clock #clock-day { font-size: 15px; font-weight: 800; display: block; }
.wopa-clock #clock-time { font-size: 34px; font-weight: 800; line-height: 1.1; letter-spacing: 2px; margin: 2px 0; direction: ltr; display: block; }
.wopa-clock #clock-date { font-size: 15px; font-weight: 800; display: block; }


@media (max-width: 768px) {
    .wopa-clock {
        top: 4px !important;
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important; /* <--- הפתרון: מכריח את הדפדפן להתעלם מה-JS ולהפוך לשורה */
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        width: max-content !important;
        padding: 2px 12px !important;
        border-radius: 12px !important; 
        white-space: nowrap !important;
    }
    .wopa-clock #clock-day { font-size: 13px !important; margin: 0 !important; }
    .wopa-clock #clock-time { font-size: 22px !important; margin: 0 !important; line-height: 1 !important; }
    .wopa-clock #clock-date { font-size: 13px !important; margin: 0 !important; }
}




/* --- iOS Install Popup --- */
#ios-install-popup {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #333;
    padding: 15px 25px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 9999;
    width: 90%;
    max-width: 320px;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.05);
    font-family: 'Assistant', sans-serif;
    direction: rtl;
}

#ios-install-popup p {
    margin: 8px 0;
    font-size: 15px;
    line-height: 1.5;
}

.close-ios-popup {
    position: absolute;
    top: 8px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #999;
    padding: 5px;
}



/* ====== עיצוב אזור החדשות (news) ====== */
.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    justify-content: center;
}

.content-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 290px;
}

.content-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.card-image {
    height: 115px;
    background-size: cover;
    background-position: center;
    position: relative;
    transition: filter 0.2s;
}

.card-image:hover { filter: brightness(1.1); }

.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.bg-ai { background: #6c5ce7; color: #fff; }
.bg-science { background: #00b894; color: #fff; }
.bg-finance { background: #fdcb6e; color: #2d3436; }
.bg-nature { background: #27ae60; color: #fff; }
.bg-music { background: #e84393; color: #fff; }
.bg-travel { background: #0984e3; color: #fff; }
.bg-culture { background: #a29bfe; color: #2d3436; }


.card-body {
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}


.card-body h3 {
    margin: 0;
    font-size: 1rem;
    color: #2d3436;
    line-height: 1.2;
    transition: color 0.2s;
}

.card-body h3:hover { color: #0984e3; }

.card-body p {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: #636e72;
    line-height: 1.3;
    flex: 1;
    overflow: hidden;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0984e3;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem;
    transition: 0.2s;
    margin-top: auto;
}

.read-more:hover {
    color: #74b9ff;
    gap: 10px;
}

/* --- התאמה למובייל וטאבלט --- */
@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .content-grid {
        grid-template-columns: 1fr; /* טור אחד במובייל */
    }
    .content-card {
        height: auto; /* מאפשר לכרטיסייה לגדול בהתאם לטקסט */
        min-height: 290px;
    }
    .card-image {
        height: 160px; /* תמונה קצת יותר גדולה במובייל */
    }
}


/* =========================================
   WOPA TV - Unified Style 2026
   ========================================= */

/* מיכל הנגן - שומר על יחס 16:9 ומרכוז */
#player-container {
    width: 100% !important;
    max-width: 1000px !important;
    position: relative !important;
    padding-bottom: 56.25% !important; 
    height: 0 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    overflow: hidden;
    margin: 20px auto !important;
    background: #000;
    z-index: 10;
}

#player-container iframe, #player {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none;
}

/* עיצוב כפתורי השליטה */
.controls {
    margin: 20px 0;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

.controls button {
    background-color: rgba(51, 51, 51, 0.8) !important; 
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 10px 25px !important;
    font-size: 16px !important;
    cursor: pointer;
    border-radius: 20px !important; 
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.controls button:hover:not(:disabled) {
    background-color: #e62117 !important;
    border-color: #e62117 !important;
    transform: translateY(-2px);
}

.controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* כותרת "אולי תאהב גם" */
.section-title {
    margin: 20px auto 15px;
    max-width: 1000px;
    font-weight: normal; 
    color: #fff; 
    background: rgba(0,0,0,0.4); 
    padding: 5px 15px; 
    border-radius: 15px; 
    backdrop-filter: blur(4px); 
    font-size: 1.1em;
    display: block;
    width: fit-content;
}

/* גריד הסרטונים המומלצים - תיקון קריטי */
.options-container {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; /* 4 במחשב */
    gap: 15px !important;
    width: 100% !important;
    max-width: 1000px !important;
    margin: 20px auto !important;
    padding: 0 10px;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

/* התאמה לטלפון - 2 תמונות בשורה */
@media (max-width: 600px) {
    .options-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* עיצוב תמונות ממוזערות */
.thumbnail {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
    background: rgba(34, 34, 34, 0.6); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    aspect-ratio: 16/9 !important; /* שומר על גודל קבוע */
    width: 100% !important;
}

.thumbnail:hover {
    transform: scale(1.05);
    border-color: #e62117;
}

.thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* מונע מתיחה של התמונה */
    display: block;
}


/* כתבות  */

/* === מבנה המגזין החדש - מתוקן === */
.content-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr); /* גריד 12 עמודות */
    grid-auto-rows: 290px; /* גובה בסיסי לכל שורה */
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    /* הגדרת האזורים (Template Areas) - המבנה המדויק */
    grid-template-areas:
        "row1-1 row1-1 row1-1 row1-1 row1-2 row1-2 row1-2 row1-2 row1-3 row1-3 row1-3 row1-3"
        "col2-v1 col2-v1 col2-v1 col2-h1 col2-h1 col2-h1 col2-h1 col2-h1 col2-h1 col2-v2 col2-v2 col2-v2"
        "col2-v1 col2-v1 col2-v1 col2-h2 col2-h2 col2-h2 col2-h2 col2-h2 col2-h2 col2-v2 col2-v2 col2-v2"
        "row3-1 row3-1 row3-1 row3-2 row3-2 row3-2 row3-3 row3-3 row3-3 row3-4 row3-4 row3-4";
}

/* --- שורה 1: 3 יחידות (4 עמודות כל אחת) --- */
.content-card:nth-child(1) { grid-area: row1-1; }
.content-card:nth-child(2) { grid-area: row1-2; }
.content-card:nth-child(3) { grid-area: row1-3; }

/* --- שורה 2: המבנה המורכב (מאונכות ומאוזנות) --- */
/* יחידה 4: מאונכת (גבוהה, תופסת 3 עמודות על 2 שורות גובה) - בימין */
.content-card:nth-child(4) { 
    grid-area: col2-v1; 
    height: 100%; /* תופסת גובה מלא של האזור */
}
/* יחידה 5: מאוזנת (מרכז עליון, 6 עמודות על שורה אחת) */
.content-card:nth-child(5) { 
    grid-area: col2-h1; 
}
/* יחידה 6: מאוזנת (מרכז תחתון, 6 עמודות על שורה אחת) */
.content-card:nth-child(6) { 
    grid-area: col2-h2; 
}
/* יחידה 7: מאונכת (גבוהה, תופסת 3 עמודות על 2 שורות גובה) - בשמאל */
.content-card:nth-child(7) { 
    grid-area: col2-v2; 
    height: 100%; /* תופסת גובה מלא של האזור */
}

/* הגדלת התמונה בכרטיסיות המאונכות כדי לנצל את הגובה שלהן */
.content-card:nth-child(4) .card-image,
.content-card:nth-child(7) .card-image {
    height: 280px; /* תמונה גבוהה יותר ליחידות הגבוהות */
}


/* הגדלת התמונה בכרטיסיות המאוזנות שבאמצע שורה 2 */
.content-card:nth-child(5) .card-image,
.content-card:nth-child(6) .card-image {
    height: 170px; /* אפשר לשחק עם המספר הזה (למשל 160px או 180px) עד שזה ייראה לך מושלם */
}

/* --- שורה 3: 4 יחידות מרובעות (3 עמודות כל אחת) --- */
.content-card:nth-child(8) { grid-area: row3-1; aspect-ratio: 1/1; height: auto;}
.content-card:nth-child(9) { grid-area: row3-2; aspect-ratio: 1/1; height: auto;}
.content-card:nth-child(10) { grid-area: row3-3; aspect-ratio: 1/1; height: auto;}
.content-card:nth-child(11) { grid-area: row3-4; aspect-ratio: 1/1; height: auto;}

/* --- שאר ההגדרות (צבעים דינמיים ורספונסיביות) --- */
.content-card {
    background: var(--card-bg, rgba(255, 255, 255, 0.6)) !important;
    color: var(--card-text, #333) !important;
    border: 1px solid rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.content-card h3, .content-card .read-more {
    color: var(--card-link, #000) !important;
}

/* רספונסיביות */
@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas: none; /* ביטול האזורים במובייל */
        grid-auto-rows: auto;
    }
    .content-card {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        height: auto !important;
        aspect-ratio: auto !important;
    }
}
@media (max-width: 600px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}
