/* --- Modal (Popup) --- */
.tdm-modal { 
    display: none; 
    position: fixed; 
    z-index: 100000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.7); 
    backdrop-filter: blur(5px); 
    align-items: center; 
    justify-content: center; 
}

.tdm-modal-content {
    background-color: #fff; 
    padding: 0;
    border-radius: 16px; 
    width: 90%; 
    max-width: 650px; 
    max-height: 90vh; 
    overflow-y: auto;
    position: relative; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.3); 
    animation: tdmFadeIn 0.3s ease-out;
}

/* --- סגירה מעודכנת --- */
.tdm-close { 
    position: absolute; 
    top: 15px; 
    left: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px; 
    font-weight: bold; 
    color: #555 !important; 
    background: #f1f1f1;
    text-shadow: none !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer; 
    z-index: 10; 
    line-height: 1;
    transition: all 0.2s; 
}
.tdm-close:hover { 
    background: #e0e0e0;
    color: #000 !important;
    transform: scale(1.05); 
}

/* --- שורת כותרת וממליץ (Flexbox) --- */
.tdm-modal-header-row {
    display: flex;
    justify-content: space-between; /* כותרת לימין, ממליץ לשמאל */
    align-items: center;
    padding: 20px 30px 10px 30px;
    gap: 15px;
}

#modalTitle { 
    padding: 0; 
    margin: 0; 
    font-size: 1.8rem; 
    border-bottom: none;
    flex-grow: 1;
}

/* --- תוכן וכפתורים מופרדים --- */
#modalBody { 
    padding: 0 30px 30px 30px; 
    line-height: 1.6; 
    font-size: 1.1em; 
    color: #444; 
    text-align: right;
}

#modalActions {
    display: flex;
    gap: 10px;
    justify-content: center; /* ממרכז את הכפתורים */
    flex-wrap: wrap;
    background: #f9f9f9;
    padding: 15px 30px !important;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

/* כפתור הניווט הפנימי */
#btn-navigate-internal {
    color: #ffffff !important;
    border-radius: 30px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
}
#btn-navigate-internal .dashicons {
    color: #ffffff !important;
}

/* --- עיצוב גוש הטקסט והרשימות (כתובת, שעות וכו') --- */
.tdm-details {
    font-size: 15px;
    line-height: 1.8;
    color: #444;
}

.tdm-details ul.meta-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tdm-details ul.meta-list li {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.tdm-details strong {
    color: #0073aa;
    display: inline-block;
    margin-left: 5px;
}

/* --- עיצוב הממליץ (עיגול בצד שמאל) --- */
.tdm-rec-badge {
    display: flex;
    align-items: center;
    flex-direction: row-reverse; /* תמונה בצד שמאל קיצוני, טקסט מימינה */
    gap: 10px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.tdm-rec-avatar img {
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;
    object-fit: cover;
    border: 2px solid #e67e22; /* מסגרת כתומה */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    display: block;
}

.tdm-rec-avatar:hover img {
    transform: scale(1.1);
}

.tdm-rec-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* יישור טקסט לשמאל */
    line-height: 1.2;
}

.tdm-rec-label {
    font-size: 11px;
    color: #888;
}

.tdm-rec-name {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.tdm-rec-name:hover {
    color: #e67e22;
}

/* --- Slider Styles --- */
#modalImageContainer {
    width: 100%;
}

.tdm-slider-wrapper {
    position: relative;
    width: 100%;
    height: 350px;
    background: #f0f0f0;
    overflow: hidden;
}

.tdm-slide {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    animation: tdmFade 0.5s;
}

/* כפתורי ניווט */
.tdm-prev, .tdm-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.3);
    text-decoration: none;
    z-index: 5;
}

.tdm-next { right: 0; border-radius: 3px 0 0 3px; }
.tdm-prev { left: 0; border-radius: 0 3px 3px 0; }
.tdm-prev:hover, .tdm-next:hover { background-color: rgba(0,0,0,0.8); color: #fff; }

/* אנימציות */
@keyframes tdmFadeIn { from {opacity: 0; transform: translateY(20px);} to {opacity: 1; transform: translateY(0);} }
@keyframes tdmFade { from {opacity: .4} to {opacity: 1} }

/* --- התאמה למובייל --- */
@media (max-width: 600px) {
    .tdm-modal-header-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    
    .tdm-rec-badge {
        width: 100%;
        flex-direction: row; /* במובייל הממליץ חוזר לכיוון רגיל */
        justify-content: flex-start;
        margin-top: 10px;
    }

    .tdm-rec-info {
        align-items: flex-start; /* יישור טקסט לימין במובייל */
    }

    .tdm-rec-avatar img {
        margin-left: 10px; /* רווח קטן */
    }
}


/* --- Recommendation Modal Specifics --- */
.tdm-rec-content {
    background-color: #fff;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px; /* צר יותר ממודל אטרקציה */
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    animation: tdmFadeIn 0.3s ease-out;
}

.tdm-rec-body {
    padding: 30px;
}

.tdm-close-rec {
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.tdm-close-rec:hover {
    color: #333;
}