/* קובץ: style.css - פתרון סופי ויציב */

/* איפוס בסיסי וסגנון גופנים */

.choice-group {
    background-color: white;
    border-radius: 12px;
    padding-bottom : 20px;

    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    /*max-width: 600px;*/ 
   /* margin: 20px auto; */
}

.group-title {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 15px;
    text-align: right; 
}

/* -------------------------------------- */
/* קבוצת הבחירה המחוברת (הבסיס) */
/* -------------------------------------- */
.segmented-control {
    display: flex;
    /* הגבול הראשי עם פינות מעוגלות - זה יוצר את העיגול החיצוני */
    border: 1px solid #ccc; 
    border-radius: 10px; 
    overflow: hidden; 
    position: relative; 
}

.hidden-radio {
    display: none;
}

.custom-label {
    flex: 1; 
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    padding: 10px 15px; 
    background-color: #fff; 
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s; 
    position: relative; 
    min-height: 60px; 
    box-sizing: border-box; 
    z-index: 1;
    /* גבול הפרדה אנכי משמאל (בגלל RTL) - זה הקו הפנימי הישר */
    border-left: 1px solid #ccc; 
}

/* מחיקת גבול ההפרדה בתווית האחרונה (השמאלית ביותר) */
.custom-label:last-child {
    border-left: none;
}

/* -------------------------------------- */
/* עיצוב טקסט ואייקונים */
/* -------------------------------------- */
    .custom-label .text {
        font-weight: 600;
        color: #123c55 !important;
       text-align:center
    }

.custom-label .subtext {
    font-size: 0.8em; 
    color: #666;
    margin-top: 3px;
}

.custom-label .icon {
    font-size: 1.2em; 
    color: #666;
    position: absolute; 
    left: 10px; 
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6; 
}

/* -------------------------------------- */
/* הדגשת בחירה (הפתרון) */
/* -------------------------------------- */

.hidden-radio:checked + .custom-label {
    background-color: #e6f0ff; /* צבע רקע תכלת */
    color: #007bff; /* צבע טקסט כחול */
    
    /* ה-box-shadow יוצר גבול כחול ברוחב 2px. */
    box-shadow: 0 0 0 2px #007bff;
    
    /* קיזוז 1px לכל כיוון גורם לתיבה הנבחרת לכסות את הגבול האפור הקיים (1px). */
    margin: -1px;
    
    /* מוחקים את הגבול האנכי של התיבה הנבחרת, אם קיים */
    border-left: none;
    
    /* z-index גבוה מבטיח שהתיבה הנבחרת תהיה מעל גבולות השכנים */
    z-index: 3; 
}

/* צבע הטקסטים והאייקונים בבחירה */
.hidden-radio:checked + .custom-label .text,
.hidden-radio:checked + .custom-label .subtext,
.hidden-radio:checked + .custom-label .icon {
    color: #007bff;
    opacity: 1;
}

/* ודא שגבול ההפרדה האנכי של השכן שמימין לתיבה הנבחרת יעלם.
   הקיזוז של ה-margin כבר מטפל בכך, אך נוסיף כלל ספציפי ליציבות: */
.hidden-radio:checked + .custom-label + .custom-label {
    /* התיבה הנבחרת מכסה את גבול ה-border-left של שכנתה.
       נבטיח שהתיבה שנבחרה לא תפריע לגבול של שכנתה. */
}