/* === בסיס כללי ל-BBCode === */
.bbcode {
  font-family: Arial;
  font-size: 15px;
  line-height: 1.4; /* צומצם מ-1.6 */
  color: #222;
  word-wrap: break-word;
}

/* === טקסט מודגש, נטוי, קו תחתון, חוצה === */
.bbcode b, .bbcode strong { font-weight: bold; }
.bbcode i, .bbcode em    { font-style: italic; }
.bbcode u                { text-decoration: underline; }
.bbcode s, .bbcode del   { text-decoration: line-through; }

/* === כותרות === */
.bbcode h1 { font-size: 1.8em; margin: .2em 0; }
.bbcode h2 { font-size: 1.6em; margin: .2em 0; }
.bbcode h3 { font-size: 1.4em; margin: .2em 0; }
.bbcode h4 { font-size: 1.2em; margin: .2em 0; }
.bbcode h5 { font-size: 1.1em; margin: .2em 0; }
.bbcode h6 { font-size: 1.0em; margin: .2em 0; }

/* === יישור טקסט === */
.bb-align-center, .bbcode .center { text-align: center; }
.bb-align-right, .bbcode .right   { text-align: right; }
.bb-align-left,  .bbcode .left    { text-align: left; }
.bb-align-justify                 { text-align: justify; }
.bb-indent {
  margin-inline-start: 10px;
  padding-inline-start: 10px;
  border-inline-start: 0px solid #e0e0e0;
}

/* === צבעים (מובנים) === */
.bbcode .color-red    { color: red; }
.bbcode .color-blue   { color: blue; }
.bbcode .color-green  { color: green; }
.bbcode .color-yellow { color: #ff0; }
.bbcode .color-black  { color: #000; }
.bbcode .color-white  { color: #fff; }
.bbcode .color-gray   { color: #777; }
.bbcode .color-orange { color: orange; }
.bbcode .color-purple { color: purple; }

/* === גדלים (מדרגות מוכנות) === */
.bb-size-1 { font-size: 0.75em; }
.bb-size-2 { font-size: 1em; }
.bb-size-3 { font-size: 1.25em; }
.bb-size-4 { font-size: 1.5em; }
.bb-size-5 { font-size: 1.75em; }
.bb-size-6 { font-size: 2em; }
.bb-size-7 { font-size: 2.25em; }
.bb-size-8 { font-size: 2.5em; }
.bb-size-9 { font-size: 2.75em; }
.bb-size-10 { font-size: 3em; }

/* === קישורים === */
.bbcode a {
  color: #6AC6EF !important;
  text-decoration: none;
}
.bbcode a:hover { text-decoration: underline; }

/* === תמונות === */
.bbcode img, .bb-img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px auto;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: none;
}

/* אפשרות תמונה ממוזערת */
.bb-thumb {
  max-width: 150px;
  height: auto;
  margin: 5px;
  border: 1px solid #ccc;
}

/* === וידאו יוטיוב === */
.bb-youtube {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16/9;
  display: block;
  margin: 12px auto;
  border: none;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.bb-youtube iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* === ציטוט === */
.bb-quote {
  border-inline-start: 4px solid #ccc;
  padding: 8px 12px;
  margin: 8px 0; /* צומצם */
  background: #f7f7f7;
  border-radius: 4px;
  font-style: italic;
}
.bb-quote cite {
  display: block;
  font-weight: bold;
  margin-bottom: 4px;
}

/* === קוד === */
.bb-code, .bb-pre {
  background: #111;
  color: black;
  padding: 10px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: Consolas, monospace;
  font-size: 14px;
  white-space: pre-wrap;
  line-height: 1.4;
}
.bb-pre { white-space: pre; }

/* קוד בתוך preview */
.bb-preview pre.bb-code {
  background:#111 !important;
  color:#eee !important;
  padding:12px;
  border-radius:8px;
  border:none;
  overflow-x:auto;
  font-family:Consolas, monospace;
  font-size:14px;
  line-height:1.4;
}

/* === ספוילר (סגנון PTP) === */
.spoiler {
    color: black;
    background-color: black;
}
.spoiler:hover {
    color: white;
}

/* === טקסט מתקפל [hide] === */
.bb-hide { margin: 8px 0; }
.bb-hide summary {
  cursor: pointer;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  background: #f0f0f0;
  border: 1px solid #ddd;
}
.bb-hide[open] summary { border-bottom: 1px solid #ccc; }
.bb-hide > div {
  margin-top: 4px;
  padding: 10px;
  border: 1px solid #ddd;
  border-top: none;
  background: #fafafa;
}

/* === רשימות === */
.bb-list {
  list-style: disc;
  margin: 0 0 0.5em 1.5em; /* צומצם */
  padding: 0;
}
.bb-list[type="1"],
.bb-list[type="a"],
.bb-list[type="A"],
.bb-list[type="i"],
.bb-list[type="I"] {
  list-style-type: decimal;
  margin: 0 0 0.5em 1.5em; /* צומצם */
  padding: 0;
}
.bb-list[type="a"] { list-style-type: lower-alpha; }
.bb-list[type="A"] { list-style-type: upper-alpha; }
.bb-list[type="i"] { list-style-type: lower-roman; }
.bb-list[type="I"] { list-style-type: upper-roman; }
.bb-list-alpha { list-style: lower-alpha; }
.bb-list-roman { list-style: upper-roman; }
.bbcode li { margin-bottom: 2px; line-height: 1.4; }

/* === טבלאות === */
.bb-table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
  background: #fff;
}
.bb-table td, .bb-table th {
  border: 1px solid #ccc;
  padding: 6px 10px;
  text-align: center;
}
.bb-table th { background: #eee; font-weight: bold; }

/* === עברית/אנגלית === */
.bb-he { direction: rtl; text-align: right; }
.bb-en { direction: ltr; text-align: left; }

/* === בלוקים מיוחדים === */
.bb-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  padding: 10px;
  border-radius: 4px;
}
.bb-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
  padding: 10px;
  border-radius: 4px;
}
.bb-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  padding: 10px;
  border-radius: 4px;
}
.bb-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  padding: 10px;
  border-radius: 4px;
}

/* === טקסט מיוחד === */
.bb-monospace { font-family: monospace; }
.bb-highlight { background: yellow; }
.bb-smallcaps { font-variant: small-caps; }
.bb-uppercase { text-transform: uppercase; }
.bb-lowercase { text-transform: lowercase; }
.bb-capitalize { text-transform: capitalize; }

/* === בלוק שורות === */
.bb-pre {
  white-space: pre;
  font-family: monospace;
  background: #f4f4f4;
  border: 1px solid #ddd;
  padding: 6px;
  border-radius: 4px;
}

/* === יישור RTL/LTR === */
.bb-rtl { direction: rtl; text-align: right; }
.bb-ltr { direction: ltr; text-align: left; }

/* === הדגשה מיוחדת === */
.bb-mark {
  background: #ff0;
  color: #000;
  padding: 0 2px;
  border-radius: 2px;
}

/* === בלוק טקסט עם מסגרת === */
.bb-box {
  border: 1px solid #bbb;
  padding: 10px;
  margin: 6px 0; /* צומצם */
  border-radius: 4px;
  background: #fafafa;
}
ul {
  margin: 0;
  padding-left: 20px;
}
ul li {
  margin-bottom: 0;
  line-height: 1.4;
}

/* תיקון ספציפי לאייקוני FontAwesome */
i.fa,
i.fas,
i.far,
i.fal,
i.fad,
i.fab,
.fa-solid,
.fa-regular,
.fa-brands {
  font-family: "Font Awesome 6 Free" !important;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
}
.fa-solid { font-weight: 900 !important; }
.fa-regular { font-weight: 400 !important; }
.fa-brands {
  font-family: "Font Awesome 6 Brands" !important;
  font-weight: 400 !important;
}

/* === טקסט שחור בתיבות === */
.bb-info, .bb-warning, .bb-error, .bb-success{
  color:#000 !important;
  font-weight:600;
}
.bb-info a, .bb-warning a, .bb-error a, .bb-success a{
  color:inherit;
  text-decoration: underline;
}

/* === וידאו/אודיו מה-parser === */
.bb-video, .bb-audio{
  display:block;
  max-width:100%;
  margin:10px auto; /* צומצם */
}

/* === פריסה דו-לשונית [עברית]/[אנגלית] מה-parser === */
.desc2-wrap{ margin:8px 0; }
.desc2-table{ width:100%; border-collapse:collapse; border-spacing:0; }
.desc2-td{ vertical-align:top; width:50%; padding:6px; }
.desc2-col.en{ direction:ltr; text-align:left; }
.desc2-col.he{ direction:rtl; text-align:right; }
form {
  margin: 0;
}
form .form-group, 
form .row {
  margin-bottom: 8px; /* במקום 20-30px */
}
.card, .content-box {
  padding: 12px 16px; /* במקום 30-40px */
}
/* מבטל מרווחים מיותרים בכותרות ובפסקאות */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0.2em !important;
  margin-bottom: 0.2em !important;
}

p {
  margin-top: 0.2em !important;
  margin-bottom: 0.2em !important;
}

/* ריווח בתוך תיבת ה-BBCode */
.bbcode {
  line-height: 1.4;
}
.bbcode p {
  margin: 0.2em 0 !important;  /* במקום 0.4em */
}
.bbcode br {
  line-height: 1.2; /* שלא יוסיף גובה מוגזם */
}

/* מרווח תחתון של .details-desc */
.details-desc {
  margin-top: 2px !important;
  margin-bottom: 4px !important;
}
/* אובררייד סופי לריווחים מיותרים */
.bbcode, .details, .form-box, .container-box {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}
/* Fix for BBCode list item spacing */
.bb-list li {
  margin-bottom: 0px; /* הקטנת הרווח מתחת לפריט */
  padding-bottom: 0;
}