/* ===========================================
    Matching System – Frontend Grid & Pagination
    =========================================== */

.msp-event-matches {
    width: 100%;
    margin: 20px auto;
    box-sizing: border-box;
    direction: rtl;
}

/* --- תיקון שורת החיפוש: מרכוז, רוחב ומרחק מהגריד --- */
.msp-find-form-wrapper {
    width: 100%;
    display: block;
    text-align: center; /* עוזר למרכוז פנימי */
    margin-bottom: 80px !important; /* מרחק משמעותי מהגריד */
    padding: 20px 0;
}

.msp-find-form {
    display: inline-flex; /* מאפשר למרכז את כל הקומפלקס */
    gap: 15px;
    width: 100%;
    max-width: 700px; /* רוחב נדיב יותר כפי שביקשת */
    margin: 0 auto !important; /* מרכוז כפוי */
    align-items: center;
    justify-content: center;
}

#msp-identifier {
    flex: 2;
    height: 50px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 0 20px;
    font-size: 18px;
}

#msp-find-btn {
    flex: 1;
    height: 50px;
    background: #d35400 !important;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    white-space: nowrap;
    padding: 0 25px;
}

/* ריווח נוסף לאזור התוצאות כדי לוודא שאין הצמדה */
.msp-results {
    margin-top: 40px;
    clear: both;
}

/* -----------------------------------
    כרטיס גריד - מבנה
    ----------------------------------- */
.msp-card {
    background: #ffffff;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    margin-bottom: 15px;
    box-sizing: border-box;
    overflow: visible; /* מאפשר לבאדג' לבלוט */
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid transparent;
}

/* סימון כרטיס שקיבל לייק */
.msp-card.received-like {
    border: 2px solid #27ae60 !important;
    background-color: #f9fff9;
}

.msp-badge-received-like {
    position: absolute;
    top: -15px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    z-index: 99;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.msp-card-top {
    display: flex;
    flex-direction: row;
}

.msp-card-left {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.msp-card-avatar {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.msp-card-right {
    margin-right: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: right;
}

.msp-card-name {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 6px;
    color: #333;
}

.msp-card-field-row {
    margin-bottom: 5px;
    font-size: 14px;
}

.msp-field-value {
    color: #555;
}

/* -----------------------------------
    שורת הפעולות והפידבק - תיקון ה-Opacity
    ----------------------------------- */
.msp-card-actions {
    margin-top: auto;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-top: 10px;
    gap: 10px;
}

.msp-card-button {
    flex: 1;
    padding: 10px 16px;
    background: #d35400 !important;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
}

/* כפתורי פידבק - סלקטור רחב כדי שיעבוד גם במודאל וגם בגריד */
.msp-feedback-btn {
    all: unset !important;
    box-sizing: border-box !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: 0.2s;
    flex-shrink: 0 !important;
}

.msp-feedback-btn.like { background-color: #27ae60 !important; }
.msp-feedback-btn.dislike { background-color: #c0392b !important; }

.msp-feedback-btn .dashicons {
    color: #ffffff !important;
    font-size: 22px !important;
    width: 22px !important;
    height: 22px !important;
    line-height: 1 !important;
}

/* כאן התיקון לכפתורים ה"דלוקים" */
button.msp-feedback-btn:not(.active) { 
    opacity: 0.3 !important; /* חוזרים למצב חצי שקוף כשלא לחוץ */
}

button.msp-feedback-btn.active { 
    opacity: 1 !important; 
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
}

/* -----------------------------------
    גריד וריספונסיביות
    ----------------------------------- */
.msp-grid-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

@media (min-width: 768px) {
    .msp-grid-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .msp-find-form {
        flex-direction: column;
        max-width: 100%;
    }
    #msp-identifier, #msp-find-btn {
        width: 100%;
    }
}

/* דפדוף */
.msp-pagination {
    display: flex;
    justify-content: center;
    align-items: center; /* זה המפתח ליישור אנכי */
    gap: 10px;
    direction: rtl;
    margin-top: 20px;
    flex-wrap: wrap; /* מונע שבירה בניידים */
}

.msp-dots {
    display: inline-block;
    padding: 5px 2px;
    line-height: 1; /* מוודא שהגובה לא חורג */
    color: #999;
    font-size: 18px;
    vertical-align: middle;
}

.msp-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 35px; /* נותן גובה אחיד לכל הכפתורים */
    padding: 0 10px;
    /* יתר ההגדרות שלך למטה... */
}

.msp-page-btn {
    background: none !important;
    border: none !important;
    color: #3498db !important;
    cursor: pointer;
    text-decoration: underline;
}

.msp-page-btn.active {
    color: #333 !important;
    font-weight: bold;
    text-decoration: none;
}

/* עיצוב כותרת הודעת הפתיחה */
.msp-welcome-header h3 {
    font-size: 1rem;    /* מקטין את הטקסט (שנה ל-1rem אם תרצה עוד יותר קטן) */
    margin-bottom: 30px;  /* יוצר ריווח מהגריד שמתחת */
    font-weight: 600;     /* עובי הטקסט */
    color: #d8691a;       /* צבע כתום תואם למותג, או #333 לשחור/אפור */
    text-align: center;   /* ממרכז את הטקסט */
}

/* אופציונלי: ריווח כללי לכל אזור הכותרת */
.msp-welcome-header {
    padding: 10px 0;
}

/* עיצוב הודעת הפתיחה והתאמה למובייל */
.msp-welcome-header {
    margin-bottom: 40px; /* ריווח משמעותי מהגריד */
    padding: 0 15px;      /* מונע מהטקסט להיצמד לקצוות במסכים קטנים */
}

.msp-welcome-header h3 {
    font-size: 1.1rem;    /* גודל קטן ואלגנטי יותר מהברירת מחדל */
    font-weight: 600;     /* עובי טקסט ברור אך לא גס */
    color: #d8691a;       /* הצבע הכתום של המותג שלך */
    text-align: center;   /* מרכוז הטקסט */
    line-height: 1.4;     /* ריווח בין שורות אם הטקסט נשבר */
}

/* התאמה למסכים קטנים (סמארטפונים) */
@media (max-width: 600px) {
    .msp-welcome-header h3 {
        font-size: 1rem;  /* הקטנה נוספת בטלפונים */
        margin-bottom: 25px;
    }
}