/* style.css - קוד מלא מעודכן לסגנון יוקרתי (Premium/Dark Mode Light) */
@charset "UTF-8";

body {
    font-family: 'Heebo', sans-serif;
    margin: 0; padding: 0;
    /* רקע דרמטי: אפור כחלחל כהה */
    background-color: #1f2a38; 
    color: #e0e0e0; /* צבע טקסט בהיר */
    direction: rtl; text-align: right;
}
.container {
    max-width: 1200px; margin: 40px auto; padding: 40px;
    background-color: #ffffff; /* המארז הראשי נשאר לבן כדי לייצר ניגודיות */
    border-radius: 16px; 
    /* צל עמוק ויוקרתי */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); 
    color: #333; /* טקסט בתוך הקונטיינר חוזר לכהה */
}

/* כותרת עליונה */
header { 
    text-align: center; 
    border-bottom: 2px solid #ddd; 
    padding-bottom: 25px; 
    margin-bottom: 35px; 
}
header h1 {
    font-size: 2.2em; /* הגדלה קלה */
    color: #197c63; /* כחול מבטא */
    margin-top: 0;
    font-weight: 700;
}
.main-logo { 
    max-width: 150px;
    margin-bottom: 20px;
}

/* סרגל חיפוש ופרטי לקוח */
.search-container {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 12px;
}
#searchInput {
    padding: 12px 20px;
    width: 300px;
    border: 1px solid #ccc;
    border-radius: 10px; /* פינות עגולות */
    font-size: 1.1em;
    background: #fff;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.1);
}
.search-container button {
    padding: 12px 25px;
    background-color: #28a745; /* ירוק מבטא */
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4); /* צל קופצני */
}
.search-container button:hover {
    background-color: #218838;
    box-shadow: 0 2px 5px rgba(40, 167, 69, 0.6);
}
#clientIdDisplay {
    margin-top: 20px; 
    font-size: 1.3em; 
    color: #197c63; 
    min-height: 20px;
    font-weight: 700;
}

/* --- תובנת AI ממוקדת --- */
.insight-box { 
    padding: 25px; 
    border-radius: 12px; 
    margin-bottom: 35px; 
    border-right: 6px solid; 
    background: #fdfdfd; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
}
.insight-box h2 {
    font-size: 1.5em;
    color: #007bff;
}
.insight-box.urgent { 
    border-color: #f44336; 
    background-color: #fff8f8; 
}
.insight-box.success { 
    border-color: #28a745; /* ירוק חד יותר */
    background-color: #f8fff8; 
}
.insight-box.pending { 
    border-color: #ff9800; 
    background-color: #fffcf8; 
}

/* --- קונטיינר כרטיסי תיק --- */
.case-card-container {
    display: flex;
    flex-direction: column;
    gap: 30px; 
    margin-top: 25px;
}

/* --- כרטיס תיק בודד (DETAILS CARD) --- */
.details-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px; /* עגול יותר */
    padding: 25px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1); /* צל עדין */
    border-top: 5px solid #0056b3; 
}

/* צבעי קו מפריד לפי סוג התיק */
.details-card.sheet-onboarding { border-top-color: #28a745; } 
.details-card.sheet-transfer { border-top-color: #007bff; } 
.details-card.sheet-rejection { border-top-color: #f44336; } 

.details-card h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #007bff; 
    font-size: 1.3em;
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* כפתור הרחבה - סמלי Font Awesome */
.expand-btn {
    background: none;
    border: none;
    font-size: 1.4em; 
    cursor: pointer;
    color: #007bff; 
    padding: 0;
    line-height: 1;
    transition: all 0.3s;
    height: 1.2em; 
    display: flex;
    align-items: center;
}

/* --- פרטי התיק (הגריד) --- */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee; 
    margin-bottom: 20px;
}

.details-grid .detail-item.extra-detail {
    display: none;
}
.details-card.expanded .details-grid .detail-item.extra-detail {
    display: block;
}

.detail-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 10px; /* פינות עגולות */
    border: 1px solid #e9ecef;
    transition: box-shadow 0.3s;
}
.detail-item:hover {
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.1); /* הילה קלה בכחול */
}

.detail-label {
    display: block;
    font-size: 0.9em;
    color: #6c757d; /* אפור עדין */
    margin-bottom: 6px;
}

.detail-value {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
    word-break: break-word; 
}

/* --- ציר זמן פנימי לכל כרטיס תיק - עיצוב עיגולים (תיקון קו) --- */
.internal-timeline { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    text-align: center; 
    margin-top: 10px;
    padding: 10px 0;
    position: relative;
    overflow: hidden;
}

/* הקו שמחבר את העיגולים - קו אפור עדין קבוע */
.internal-timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 20px; 
    left: 20px; 
    height: 3px; 
    background: #e0e0e0; 
    z-index: 1;
    transform: translateY(-50%);
}

/* הקו הדינמי - לטיפול בצביעה של הקו שהושלם */
.internal-timeline::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 20px;
    width: 0%; 
    height: 3px;
    background: #28a745; /* ירוק מבטא */
    z-index: 2; 
    transform: translateY(-50%);
    transition: width 0.5s ease-in-out;
}

/* הגדרות רוחב הקו הדינמי לפי הצלחה (Success Count) */
.internal-timeline.success-0::after { width: 0%; }
.internal-timeline.success-1::after { width: 0%; } 
.internal-timeline.success-2::after { width: 50%; } 
.internal-timeline.success-3::after { width: 100%; } 


.timeline-step { 
    flex: 1 1 0; 
    padding: 5px; 
    font-weight: 600; 
    font-size: 0.9em;
    color: #6c757d; 
    position: relative;
    z-index: 3; 
    background: #fff; 
    flex-shrink: 1;
}

/* העיגול עצמו - כפתור דרמטי */
.timeline-step::before {
    content: attr(data-step); 
    display: flex; 
    justify-content: center;
    align-items: center;
    width: 40px; /* הגדלה משמעותית */
    height: 40px;
    margin: 0 auto 8px;
    border-radius: 50%;
    background: #f0f2f5; 
    color: #6c757d;
    border: 3px solid #ddd; /* בורדר עבה יותר */
    transition: all 0.4s ease;
    flex-shrink: 0; 
    font-size: 1.2em;
}

.timeline-step.success::before { 
    background: #28a745; /* ירוק מבטא */
    color: #fff; 
    border-color: #28a745;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.7); /* הילה חזקה */
}
.timeline-step.failure::before { 
    background: #f44336; 
    color: #fff; 
    border-color: #f44336;
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.7); 
}

/* --- נתונים גולמיים --- */
#rawDataDetails {
    margin-top: 40px;
}
#jsonData { 
    background: #2b3e50; /* רקע כהה לקוד/דאטה גולמי */
    color: #eee;
    padding: 15px; 
    direction: ltr; 
    text-align: left; 
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ================================================= */
/* 📱 מדיה קווריות לרספונסיביות (כמו קודם, מותאם לצבעים החדשים) */
/* ================================================= */

@media (max-width: 900px) {
    .container {
        margin: 20px 10px;
        padding: 15px;
    }
    
    .details-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    /* ציר זמן פנימי */
    .timeline-step {
        font-size: 0.75em;
    }
    
    .timeline-step::before {
        width: 30px;
        height: 30px;
    }
    .internal-timeline::before, .internal-timeline::after {
        right: 15px; 
        left: 15px; 
    }
}

@media (max-width: 600px) {
    .search-container {
        flex-direction: column;
        gap: 15px;
    }
    #searchInput, .search-container button {
        width: 100%;
        max-width: none;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .internal-timeline {
        overflow: visible; 
        font-size: 0.7em;
    }
    
    .timeline-step {
        flex: 1 1 0; 
        padding: 5px 2px;
        white-space: normal; 
    }
    
    .timeline-step::before {
        width: 25px;
        height: 25px;
        font-size: 0.9em;
    }
}