@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;600;800&family=Rubik:wght@400;600;800&display=swap');

:root {
    --bg-1:#f4fbfb;   /* תכלת־קריר רך */
    --bg-2:#f7f3fb;   /* סגלגל־לילך בהיר */
    --bg-3:#fff9ed;   /* צהבהב שמנתי בהיר */
    --bg-4:#fdf1f4;   /* ורדרד עדין */
    --bg-5:#f5faf5;   /* ירקרק רך מאוד */
    --ink:#0f172a;
    --primary:#9b5de5;
    --primary-700:#f15bb5;
    --ring:rgba(155,93,229,.35);
    --radius:30px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    direction: rtl;
    text-align: right;
    font-family: 'Heebo','Rubik','David',sans-serif;
    color: var(--ink);
    background:
      radial-gradient(1200px 600px at 15% 10%, var(--bg-2) 0%, transparent 70%),
      radial-gradient(1000px 700px at 85% 20%, var(--bg-3) 0%, transparent 70%),
      radial-gradient(900px 500px at 50% 80%, var(--bg-4) 0%, transparent 70%),
      radial-gradient(700px 400px at 10% 85%, var(--bg-5) 0%, transparent 70%),
      linear-gradient(135deg, var(--bg-1) 0%, #ffffff 100%);
}

/* מעטפת כללית */
.page-wrap {
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 2.5rem 2.7rem;
    background: rgba(255,255,255,0.96);
    border-radius: var(--radius);
    box-shadow: 0 20px 55px rgba(15,23,42,0.14);
    border: 1px solid rgba(148,163,253,0.22);
}

/* כותרות */
h1, h2 {
    text-align: center;
    font-family: 'Rubik','Heebo',sans-serif;
    color: #111827;
    text-shadow: 0 1px 2px rgba(255,255,255,0.9);
    margin: 0 0 1rem;
}

h1 {
    font-size: 2.2rem;
    font-weight: 800;
}

h2 {
    font-size: 1.45rem;
    font-weight: 700;
}

/* תת כותרת */
.subtitle {
    text-align: center;
    margin-top: -0.4rem;
    margin-bottom: 2rem;
    color: #475569;
    font-size: 1rem;
}

/* כרטיס כללי */
.card {
    padding: 1.6rem 1.9rem;
    margin-bottom: 1.6rem;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid rgba(226,232,255,0.9);
    box-shadow: 0 10px 30px rgba(15,23,42,0.06);
}

/* הוראות */
.instructions {
    margin: 0.4rem 1.2rem 0;
    padding-right: 1.2rem;
    color: #374151;
    font-size: 0.97rem;
}
.instructions li { margin-bottom: 0.35rem; }

/* === דוגמה לשימוש – שני כרטיסים שווים === */
.examples {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.6rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* כל כרטיס דוגמה */
.examples > div {
    flex: 1;
    background: #F9FAFF;
    padding: 1rem 1.2rem 1.1rem;
    border-radius: 18px;
    border: 1px solid rgba(226,232,255,0.9);
    box-shadow: 0 6px 16px rgba(15,23,42,0.04);
    min-width: 380px;
}

/* כותרת קטנה בתוך כרטיס הדוגמה */
.examples h3 {
    margin: 0 0 0.6rem;
    font-size: 1.08rem;
    font-weight: 700;
    color: #111827;
    text-align: center;
}

/* טבלת הדוגמה */
.examples .table-wrap {
    margin-top: 0.4rem;
    overflow-x: auto;
}

.examples table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.examples th, .examples td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #E5E7EB;
    white-space: nowrap;
}

.examples thead {
    background: #EEF2FF;
}

.examples th {
    font-weight: 600;
    color: #111827;
}

/* טפסי העלאה */
.upload-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem 1.6rem;
    align-items: end;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.95rem;
}

.field label {
    font-weight: 600;
    color: #111827;
}

.field input[type="file"] {
    padding: 0.45rem;
    border-radius: 14px;
    border: 1px solid #CBD5F5;
    background: #F9FAFB;
    font-size: 0.9rem;
}

/* כפתור */
.btn-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.primary-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 2.6rem;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(90deg,var(--primary) 0%,var(--primary-700) 100%);
    box-shadow: 0 14px 30px var(--ring);
    transition: all .16s ease;
}
.primary-btn:hover {
    transform: translateY(-3px) scale(1.02);
    filter: brightness(1.07);
}

/* שורה של כפתורים */
.btn-row {
    margin-top: 0.9rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* הודעות שגיאה */
.alert {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.92rem;
}
.alert.error {
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FCA5A5;
}

/* טבלאות */
.table-wrap {
    margin-top: 0.7rem;
    overflow-x: auto;
}
.table-wrap.small { max-width: 100%; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
thead {
    background: #EEF2FF;
}
th, td {
    padding: 0.4rem 0.55rem;
    border-bottom: 1px solid #E5E7EB;
    white-space: nowrap;
}
th {
    font-weight: 600;
    color: #111827;
}
td.score {
    font-weight: 700;
}

tr.good td:last-child {
    color: #15803D;
    font-weight: 600;
}
tr.bad td:last-child {
    color: #B91C1C;
    font-weight: 600;
}

/* רספונסיביות */
@media (max-width:900px) {
    .page-wrap {
        margin: 1rem;
        padding: 1.6rem;
    }
    .examples {
        flex-direction: column;
    }
    .upload-form {
        grid-template-columns: 1fr;
    }
    .btn-wrap {
        justify-content: stretch;
    }
    .primary-btn {
        width: 100%;
    }
}
/* ====== ניווט הסבר ציון ====== */
#explain-card .btn-row{
  display:flex;
  justify-content:space-between;   /* שמאל/ימין כמו בדוגמה */
  align-items:center;
  gap:16px;
  margin-top:16px;
}

#explain-card .btn{
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 22px;
  font-weight:700;
  border-radius:9999px;            /* גלולות */
  border:0;
  cursor:pointer;
  white-space:nowrap;
  transition:transform .12s ease, box-shadow .12s ease, background .12s ease;
  min-width:120px;                 /* גודל נוח */
}

/* צבעוני (Primary) – כמו הכפתורים היפים שלך */
#explain-card .btn--primary{
  background:var(--grad-main, linear-gradient(90deg,#f05da8 0%,#a855f7 100%));
  color:#fff;
  box-shadow:0 10px 24px rgba(168,85,247,.18);
}
#explain-card .btn--primary:hover{ transform:translateY(-1px); }

/* Ghost בהיר לימין */
#explain-card .btn--ghost{
  background:#f6f8fb;
  color:#6b7280;
  border:1px solid #e5e7eb;
  box-shadow:0 6px 18px rgba(15,23,42,.06);
}
#explain-card .btn--ghost:hover{ background:#eef2f7; }

/* ביטול רוחב-מלא אם הוגדר היסטורית */
#explain-card .primary-btn,
#explain-card .secondary-btn{
  width:auto !important;
  display:inline-flex !important;
}
/* ===== כפתורי דפדוף – תיקון רספונסיבי ===== */
#explain-card .btn-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  overflow:visible;           /* שלא יווצר פס גלילה אפור */
}

#explain-card .btn{
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 22px;
  font-weight:700;
  border-radius:9999px;
  border:0;
  cursor:pointer;
  white-space:nowrap;
  transition:transform .12s ease, box-shadow .12s ease, background .12s ease;
  min-width:120px;            /* במסך רגיל */
}

/* צבעים קיימים שלך (השארתי כמו שהגדרת קודם) */
#explain-card .btn--primary{
  background:var(--grad-main, linear-gradient(90deg,#f05da8 0%,#a855f7 100%));
  color:#fff;
  box-shadow:0 10px 24px rgba(168,85,247,.18);
}
#explain-card .btn--ghost{
  background:#f6f8fb;
  color:#6b7280;
  border:1px solid #e5e7eb;
  box-shadow:0 6px 18px rgba(15,23,42,.06);
}

/* ===== מסכים צרים: אין גלילה, אין קפיצה, הכול נכנס יפה ===== */
@media (max-width: 640px){
  #explain-card .btn-row{
    gap:12px;
  }
  #explain-card .btn{
    flex:1;                   /* כל כפתור תופס חצי שורה */
    min-width:0;              /* מונע גלילה/פס אפור */
    padding:12px 16px;        /* יותר נעים למגע */
  }
}

/* אפשרות: מסכים ממש-ממש צרים – לעבור לשורה מתחת */
@media (max-width: 380px){
  #explain-card .btn-row{
    flex-wrap:wrap;
    justify-content:center;
  }
  #explain-card .btn{
    flex:0 0 100%;
  }
}



