/* =========================================================
   DATAWEB UNIFIED UI v1.0.2
   MyBB forum index mobile card conversion
   Sadece 600px ve altında forum kategori tablolarını düzeltir.
   ========================================================= */

@media (max-width: 600px){

  html,
  body,
  #container,
  #content{
    max-width:100% !important;
    overflow-x:hidden !important;
  }

  /* MyBB kategori tablolarını mobil kart akışına çevir */
  #content table:has(> tbody[id^="cat_"]){
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    table-layout:auto !important;
    border-collapse:separate !important;
    border-spacing:0 !important;
    overflow:hidden;
  }

  #content table:has(> tbody[id^="cat_"]) > thead{
    display:block !important;
    width:100% !important;
  }

  #content table:has(> tbody[id^="cat_"]) > thead > tr,
  #content table:has(> tbody[id^="cat_"]) > thead > tr > td{
    display:block !important;
    width:100% !important;
    box-sizing:border-box !important;
  }

  #content tbody[id^="cat_"]{
    display:block !important;
    width:100% !important;
  }

  /* FORUM / KONULAR / GÖNDERİLER / SON GÖNDERİ başlık satırını mobilde gizle */
  #content tbody[id^="cat_"] > tr:first-child{
    display:none !important;
  }

  /* Her forum tek kart satırı */
  #content tbody[id^="cat_"] > tr:not(:first-child){
    display:grid !important;
    grid-template-columns:28px minmax(0,1fr) !important;
    grid-template-rows:auto auto !important;
    column-gap:10px !important;
    row-gap:5px !important;
    width:100% !important;
    box-sizing:border-box !important;
    padding:13px 12px !important;
    margin:0 !important;
    border-bottom:1px solid #edf0f5 !important;
    background:#fff !important;
  }

  #content tbody[id^="cat_"] > tr:not(:first-child):last-child{
    border-bottom:0 !important;
  }

  #content tbody[id^="cat_"] > tr:not(:first-child) > td{
    float:none !important;
    width:auto !important;
    min-width:0 !important;
    max-width:none !important;
    height:auto !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    box-sizing:border-box !important;
    text-align:left !important;
    vertical-align:top !important;
  }

  /* Durum ikonu */
  #content tbody[id^="cat_"] > tr:not(:first-child) > td:nth-child(1){
    grid-column:1 !important;
    grid-row:1 / span 2 !important;
    align-self:start !important;
    justify-self:center !important;
    padding-top:2px !important;
  }

  #content tbody[id^="cat_"] > tr:not(:first-child) > td:nth-child(1) img{
    max-width:18px !important;
    height:auto !important;
  }

  /* Forum adı + açıklama */
  #content tbody[id^="cat_"] > tr:not(:first-child) > td:nth-child(2){
    grid-column:2 !important;
    grid-row:1 !important;
    display:block !important;
  }

  #content tbody[id^="cat_"] > tr:not(:first-child) > td:nth-child(2) > strong,
  #content tbody[id^="cat_"] > tr:not(:first-child) > td:nth-child(2) > strong > a{
    font-size:13px !important;
    line-height:1.35 !important;
  }

  #content tbody[id^="cat_"] > tr:not(:first-child) > td:nth-child(2) .smalltext{
    display:block !important;
    margin-top:4px !important;
    font-size:10.5px !important;
    line-height:1.45 !important;
    color:#778398 !important;
  }

  /* Konu ve gönderi sayıları mobilde gereksiz kolon oluşturmasın */
  #content tbody[id^="cat_"] > tr:not(:first-child) > td:nth-child(3),
  #content tbody[id^="cat_"] > tr:not(:first-child) > td:nth-child(4){
    display:none !important;
  }

  /* Son gönderi bilgisi forum adının altına gelsin */
  #content tbody[id^="cat_"] > tr:not(:first-child) > td:nth-child(5){
    grid-column:2 !important;
    grid-row:2 !important;
    display:block !important;
    margin-top:2px !important;
    padding-top:5px !important;
    border-top:1px dashed #edf0f5 !important;
    font-size:10px !important;
    line-height:1.4 !important;
    color:#718096 !important;
    overflow-wrap:anywhere !important;
  }

  #content tbody[id^="cat_"] > tr:not(:first-child) > td:nth-child(5)::before{
    content:"Son gönderi: ";
    font-weight:700;
    color:#526074;
  }

  #content tbody[id^="cat_"] > tr:not(:first-child) > td:nth-child(5) a{
    font-size:10px !important;
    line-height:1.4 !important;
  }

  /* Alt forum listeleri uzun satır üretmesin */
  #content tbody[id^="cat_"] .subforums,
  #content tbody[id^="cat_"] .smalltext{
    overflow-wrap:anywhere !important;
    word-break:normal !important;
  }

  /* Forum istatistik alanlarında masaüstü sabit genişlikleri bırakma */
  #content .tborder td[width],
  #content .tborder th[width]{
    max-width:100% !important;
  }
}
