/* ==========================================================================
   EILAM IRM - FINAL PREMIUM STYLESHEET (ORGANIZED & UNIFIED)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. הגדרות כלליות ואנימציות (General & Animations)
   -------------------------------------------------------------------------- */
@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.eilam-irm-main-container,
.eilam-irm-search-container,
.eilam-results-wrapper,
.eilam-record-single,
.eilam-intro-section {
    direction: rtl;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    line-height: 1.6;
}

.eilam-irm-main-container {
    animation: slideUpFade 0.6s ease-out;
}

/* --------------------------------------------------------------------------
   2. מקטע הקדמה וכפתורי רכישה (Intro & Paywall Buttons)
   -------------------------------------------------------------------------- */
.eilam-intro-section {
    margin-bottom: 35px;
    display: block !important;
}

.eilam-intro-text {
    font-size: 1.1em;
    margin-bottom: 25px;
}

.button-container {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important; /* חלוקה ל-3 עמודות שוות */
    gap: 15px !important;
    margin: 25px 0 !important;
}

.custom-button {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 15px 10px !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    color: white !important;
    transition: all 0.3s ease !important;
    text-align: center;
    border: none !important;
    box-sizing: border-box !important;
}

.custom-button:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 8px 15px rgba(0,0,0,0.15); 
}

.custom-button .button-main-text { font-size: 1em; font-weight: bold; line-height: 1.2; }
.custom-button .button-sub-text { font-size: 0.85em; opacity: 0.9; margin-top: 5px; }

.btn-1 { background: linear-gradient(135deg, #76D7C4, #5DADE2) !important; }
.btn-2 { background: linear-gradient(135deg, #73C6B6, #48C9B0) !important; }
.btn-3 { background: linear-gradient(135deg, #85C1E9, #5499C7) !important; }

/* --------------------------------------------------------------------------
   3. טופס החיפוש וכפתוריו (Search Form & Controls)
   -------------------------------------------------------------------------- */
.eilam-irm-form {
    background: #ffffff !important;
    padding: 30px !important;
    border-radius: 12px !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    clear: both !important;
}

.eilam-irm-form.collapsed {
    display: none !important;
}

.search-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.input-s {
    display: flex !important;
    flex-direction: column !important; /* מסדר תווית מעל שדה ומונע דריסת תבנית */
    align-items: stretch !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.input-s label {
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    font-size: 0.95em !important;
    color: #333 !important;
}

.input-s input[type="text"] {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    height: 45px !important;
    box-sizing: border-box !important;
    background-color: #fafafa !important;
}

.input-s input[type="text"]:focus {
    border-color: #48b74b !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 2px rgba(72, 183, 75, 0.2) !important;
    outline: none !important;
}

.input-s input[dir="ltr"] { text-align: left !important; }

.src-btn {
    display: flex !important;
    gap: 15px !important;
    margin-top: 25px !important;
    padding-top: 20px !important;
    border-top: 1px solid #eee !important;
    justify-content: center !important;
}

.eilam-btn-submit {
    background: #48b74b !important;
    color: #fff !important;
    padding: 12px 35px !important;
    font-weight: bold !important;
    font-size: 1.1em !important;
    border-radius: 30px !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 10px rgba(72, 183, 75, 0.3) !important;
}

.btn-clean-elegant {
    background: #f5f5f5 !important;
    color: #d63638 !important;
    padding: 10px 25px !important;
    border-radius: 30px !important;
    border: 1px solid #dcdcdc !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

.btn-edit-search {
    background: #48b74b !important;
    color: #fff !important;
    padding: 12px 25px !important;
    border-radius: 30px !important;
    text-decoration: none !important;
    font-weight: bold !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(72, 183, 75, 0.3);
    transition: all 0.3s ease;
}

.btn-edit-search:hover { transform: scale(1.05); }

/* --------------------------------------------------------------------------
   4. טבלת תוצאות החיפוש ("נושמת" ואוורירית)
   -------------------------------------------------------------------------- */
.eilam-results-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    border-right: 5px solid #48b74b;
    margin-bottom: 25px;
}

.eilam-results-count { 
    color: #1e3666 !important; 
    font-weight: bold; 
    font-size: 1.1em; 
}

.eilam-table-responsive {
    overflow-x: auto;
}

.eilam-public-table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 12px !important; /* המרווח המאוורר בין השורות */
    margin-top: -12px;
}

.eilam-public-table th { 
    background: #48b74b !important; 
    color: #fff !important; 
    padding: 15px !important; 
    text-align: right !important; 
    border: none !important; 
}

.eilam-public-table th:first-child { border-radius: 0 10px 10px 0; }
.eilam-public-table th:last-child { border-radius: 10px 0 0 10px; }

.eilam-public-table tr td { 
    background: #fff !important; 
    padding: 18px 15px !important; 
    border-top: 1px solid #eee !important;
    border-bottom: 1px solid #eee !important;
    transition: all 0.2s ease; 
}

.eilam-public-table tr td:first-child { border-right: 1px solid #eee !important; border-radius: 0 10px 10px 0; }
.eilam-public-table tr td:last-child { border-left: 1px solid #eee !important; border-radius: 10px 0 0 10px; }

.eilam-public-table tr:hover td { 
    background: #f1f8f2 !important; 
    transform: translateY(-2px); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.05); 
}

.btn-details-styled {
    background-color: #506fb6 !important;
    color: #fff !important;
    padding: 8px 18px !important;
    border-radius: 20px !important;
    text-decoration: none !important;
    font-size: 0.9em !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 5px rgba(80, 111, 182, 0.3);
}

/* --------------------------------------------------------------------------
   5. עמוד רשומה בודדת (Drilldown)
   -------------------------------------------------------------------------- */
.eilam-record-single {
    background: #fff;
    padding: 35px;
    border-radius: 12px;
    border: 1px solid #eaeaea;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

.eilam-record-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 2px solid #48b74b;
    padding-bottom: 10px;
}

.detail-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 5px;
}

.detail-table th { 
    background-color: #48b74b !important; 
    color: #ffffff !important; 
    width: 30%; 
    padding: 15px !important; 
    border-radius: 0 10px 10px 0 !important; 
    border: none !important; 
}

.detail-table td { 
    background-color: #fdfdfd !important; 
    color: #1e3666 !important; 
    padding: 15px !important; 
    border-radius: 10px 0 0 10px !important; 
    border: 1px solid #eee !important; 
    border-right: none !important; 
}

.eilam-btn-back {
    display: inline-block;
    background: #f0f0f1;
    color: #333 !important;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none !important;
    border: 1px solid #ccc;
    margin: 15px 0;
}

/* --------------------------------------------------------------------------
   6. הודעות שגיאה וולידציה (Validation)
   -------------------------------------------------------------------------- */
.eilam-field-error { 
    color: #d63638 !important; 
    font-size: 12px !important; 
    font-weight: 600 !important; 
    margin-top: 5px !important; 
    display: none !important; 
}

.input-s.has-error .eilam-field-error { 
    display: block !important; 
}

.input-s.has-error input { 
    border-color: #d63638 !important; 
    background-color: #fff8f8 !important; 
}

.eilam-global-error { 
    background-color: #d63638 !important; 
    color: #ffffff !important; 
    padding: 15px 20px !important; 
    border-radius: 8px !important; 
    margin-bottom: 20px !important; 
    text-align: center !important; 
    font-weight: bold !important; 
    font-size: 1.1em !important;
    display: none; 
}

/* --------------------------------------------------------------------------
   7. רספונסיביות (Mobile & Tablet)
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .search-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .button-container { grid-template-columns: 1fr !important; }
}

@media (max-width: 600px) {
    .search-grid { grid-template-columns: 1fr !important; }
    .src-btn { flex-direction: column !important; align-items: stretch !important; }
    
    .detail-table th, .detail-table td { 
        display: block; 
        width: 100%; 
        border-radius: 0 !important; 
    }
    .detail-table td { 
        border: 1px solid #eee !important; 
        border-top: none !important; 
        margin-bottom: 10px; 
    }
}