﻿
/* ==========================================================================
   Teachers Live — PHASE 10 FIX4
   Student Final UX + global logout icon clarity
   ========================================================================== */

.tl10f4-student-page{
  width:100%!important;
  max-width:none!important;
  margin:0!important;
}

/* Same content rhythm as Dashboard on every Student page */
body.tl10-student .tl10f4-student-page{
  padding-inline:1rem!important;
}
@media(min-width:992px){
  body.tl10-student .tl10f4-student-page{
    padding-inline:1.5rem!important;
  }
}

/* ---------- Subjects: same scale as Dashboard > موادي ---------- */
.tl10f4-subject-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:1rem!important;
}
.tl10f4-subject-card{
  position:relative;
  display:grid;
  grid-template-rows:150px auto;
  min-width:0;
  overflow:hidden;
  border:1px solid var(--tl10-line,rgba(4,31,52,.09));
  border-radius:22px;
  background:#fff;
  box-shadow:var(--tl10-shadow-sm,0 8px 24px rgba(4,23,39,.07));
  transition:transform .28s var(--tl10-ease,cubic-bezier(.2,.8,.2,1)),box-shadow .28s;
}
.tl10f4-subject-card:hover{
  transform:translateY(-6px);
  box-shadow:var(--tl10-shadow,0 18px 50px rgba(4,23,39,.10));
}
.tl10f4-subject-image-stage{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:0;
  overflow:hidden;
  padding:.55rem;
  background:
    radial-gradient(circle at 20% 20%,rgba(208,164,59,.08),transparent 7rem),
    radial-gradient(circle at 80% 75%,rgba(12,165,129,.07),transparent 8rem),
    linear-gradient(145deg,#fbfdfb,#edf4ef);
}
.tl10f4-subject-image-stage::after{
  content:"";
  position:absolute;
  inset:8px;
  border:1px solid rgba(4,31,52,.05);
  border-radius:15px;
  pointer-events:none;
}
.tl10f4-subject-image-stage img{
  width:100%;
  height:100%;
  max-width:95%;
  max-height:95%;
  object-fit:contain;
  object-position:center;
  filter:drop-shadow(0 8px 15px rgba(4,23,39,.07));
  transition:transform .28s var(--tl10-ease,cubic-bezier(.2,.8,.2,1));
}
.tl10f4-subject-card:hover img{transform:scale(1.025)}
.tl10f4-subject-body{
  display:grid;
  grid-template-rows:auto auto auto;
  gap:.55rem;
  padding:.85rem .9rem .9rem;
}
.tl10f4-subject-name{
  color:var(--tl10-navy-900,#061a2f);
  font-size:.95rem;
  font-weight:900;
}
.tl10f4-subject-counts{
  display:flex;
  flex-wrap:wrap;
  gap:.4rem;
}
.tl10f4-subject-counts span{
  padding:.25rem .48rem;
  border-radius:999px;
  background:#f0f4f2;
  color:#7b8793;
  font-size:.68rem;
  font-weight:800;
}
.tl10f4-subject-actions{
  display:flex;
  flex-wrap:wrap;
  gap:.45rem;
  align-items:center;
}
.tl10f4-subject-actions .btn{
  min-height:36px!important;
  padding:.38rem .65rem!important;
  font-size:.74rem!important;
}

/* ---------- Subject page ---------- */
.tl10f4-subject-page .tlr-grid{
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr))!important;
}
.tl10f4-subject-page .tlr-material-grid{
  display:grid;
  gap:.75rem;
}
.tl10f4-subject-page .tl-final-inline-viewer{
  max-width:none!important;
}

/* ---------- Profile ---------- */
.tl10f4-profile-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:1rem;
}
.tl10f4-phone-pending{
  display:flex;
  align-items:center;
  gap:.75rem;
  padding:.8rem;
  border:1px solid rgba(8,123,100,.14);
  border-radius:15px;
  background:linear-gradient(135deg,#f2faf6,#fff);
}
.tl10f4-phone-pending small,
.tl10f4-phone-pending strong{display:block}
.tl10f4-phone-pending small{color:#7a8795;font-size:.7rem}
.tl10f4-phone-ok{
  width:38px;height:38px;display:grid;place-items:center;
  border-radius:12px;background:#087b64;color:#fff;font-weight:900;
}

/* ---------- History: clean filters + custom reliable table ---------- */
.tl10f4-history-controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  flex-wrap:wrap;
}
.tl10f4-range-pills{
  display:flex;
  align-items:center;
  gap:.4rem;
  flex-wrap:wrap;
  padding:.3rem;
  border:1px solid rgba(4,31,52,.07);
  border-radius:15px;
  background:rgba(255,255,255,.82);
}
.tl10f4-range-pills button,
.tl10f4-advanced-filter summary{
  min-height:38px;
  border:0;
  border-radius:11px;
  padding:.42rem .75rem;
  background:transparent;
  color:#526274;
  font-size:.78rem;
  font-weight:850;
  cursor:pointer;
}
.tl10f4-range-pills button.active{
  color:#fff;
  background:linear-gradient(135deg,#061a2f,#087b64);
  box-shadow:0 7px 18px rgba(6,26,47,.13);
}
.tl10f4-advanced-filter{
  position:relative;
}
.tl10f4-advanced-filter summary{
  list-style:none;
  display:flex;
  align-items:center;
  background:#fff;
  border:1px solid rgba(4,31,52,.09);
}
.tl10f4-advanced-filter summary::-webkit-details-marker{display:none}
.tl10f4-advanced-filter-body{
  position:absolute;
  left:0;
  top:calc(100% + .4rem);
  z-index:20;
  width:min(440px,calc(100vw - 2rem));
  display:grid;
  grid-template-columns:1fr 1fr auto;
  gap:.5rem;
  padding:.75rem;
  border:1px solid rgba(4,31,52,.08);
  border-radius:16px;
  background:#fff;
  box-shadow:0 18px 50px rgba(4,23,39,.14);
}
.tl10f4-advanced-filter-body label{
  display:grid;
  gap:.25rem;
  color:#687687;
  font-size:.7rem;
  font-weight:800;
}
.tl10f4-advanced-filter-body input{
  min-height:38px;
  padding:.35rem .5rem;
  border:1px solid rgba(4,31,52,.11);
  border-radius:10px;
  background:#fff;
}
.tl10f4-history-table-head{
  align-items:center!important;
}
.tl10f4-history-tools{
  display:flex;
  align-items:center;
  gap:.55rem;
  min-width:0;
}
.tl10f4-history-search{
  position:relative;
  display:flex;
  align-items:center;
}
.tl10f4-history-search span{
  position:absolute;
  right:.65rem;
  color:#87929d;
  pointer-events:none;
}
.tl10f4-history-search input{
  width:min(260px,32vw);
  min-height:40px;
  padding:.4rem 2rem .4rem .7rem;
  border:1px solid rgba(4,31,52,.10);
  border-radius:12px;
  outline:0;
}
.tl10f4-history-search input:focus{
  border-color:rgba(8,123,100,.35);
  box-shadow:0 0 0 3px rgba(8,123,100,.07);
}
.tl10f4-page-size{
  display:flex;
  align-items:center;
  gap:.35rem;
  color:#74808e;
  font-size:.72rem;
}
.tl10f4-page-size select{
  min-height:40px;
  border:1px solid rgba(4,31,52,.10);
  border-radius:11px;
  background:#fff;
  padding:.3rem .5rem;
}
.tl10f4-history-table{
  width:100%!important;
  min-width:950px!important;
}
.tl10f4-history-table th[data-sort-index]{
  cursor:pointer;
  user-select:none;
}
.tl10f4-history-table th[data-sort-index]::after{
  content:"↕";
  margin-inline-start:.3rem;
  color:#a2abb4;
  font-size:.68rem;
}
.tl10f4-history-table th[data-sort-dir="asc"]::after{content:"↑";color:#087b64}
.tl10f4-history-table th[data-sort-dir="desc"]::after{content:"↓";color:#087b64}
.tl10f4-attendance-cell{
  display:flex;
  align-items:center;
  gap:.45rem;
  min-width:115px;
}
.tl10f4-attendance-cell .tl-progress{flex:1}
.tl10f4-pagination{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:.7rem;
  padding:1rem;
  border-top:1px solid rgba(4,31,52,.06);
}
.tl10f4-pagination button{
  min-height:36px;
  padding:.35rem .75rem;
  border:1px solid rgba(4,31,52,.10);
  border-radius:11px;
  background:#fff;
  color:#405064;
  font-size:.76rem;
  font-weight:800;
}
.tl10f4-pagination button:disabled{opacity:.4}
.tl10f4-pagination span{font-size:.75rem;color:#788593;font-weight:800}
.tl10f4-history-empty{
  padding:2rem 1rem;
  text-align:center;
  color:#7c8996;
}

/* ---------- Live materials: PDF.js canvas instead of iframe ---------- */
.tl10f4-live-pdf{
  min-height:0;
  height:100%;
  display:flex;
  flex-direction:column;
  background:#eef2f0;
}
.tl10f4-live-pdf-toolbar{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.35rem;
  padding:.5rem;
  border-bottom:1px solid rgba(4,31,52,.08);
  background:#fff;
  position:sticky;
  top:0;
  z-index:2;
}
.tl10f4-live-pdf-toolbar span{
  min-width:58px;
  text-align:center;
  font-size:.72rem;
  font-weight:850;
  color:#627181;
}
.tl10f4-live-pdf-stage{
  position:relative;
  flex:1;
  min-height:320px;
  overflow:auto;
  padding:.75rem;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  background:#dfe6e2;
}
.tl10f4-live-pdf-stage canvas{
  display:block;
  max-width:none;
  background:#fff;
  box-shadow:0 8px 28px rgba(4,23,39,.13);
}
.tl10f4-live-pdf-loading{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  color:#687687;
  background:rgba(245,248,246,.90);
  z-index:1;
  font-size:.82rem;
  font-weight:800;
}

/* ---------- Global logout icon: clearly a door + arrow, not back ---------- */
.tl10f4-logout-btn{
  display:inline-grid!important;
  place-items:center!important;
}
.tl10f4-logout-btn svg{
  width:20px;
  height:20px;
  stroke:currentColor;
  fill:none;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* Tablet */
@media(min-width:576px) and (max-width:991.98px){
  .tl10f4-subject-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  .tl10f4-subject-card{grid-template-rows:135px auto}
  .tl10f4-profile-grid{grid-template-columns:1fr}
  .tl10f4-history-tools{flex:1;justify-content:flex-end}
  .tl10f4-history-search input{width:min(250px,34vw)}
}

/* Phone */
@media(max-width:575.98px){
  body.tl10-student .tl10f4-student-page{
    padding:.9rem .85rem 118px!important;
  }
  .tl10f4-subject-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:.7rem!important;
  }
  .tl10f4-subject-card{
    grid-template-rows:98px auto;
    border-radius:18px;
  }
  .tl10f4-subject-image-stage{padding:.3rem}
  .tl10f4-subject-body{
    gap:.4rem;
    padding:.65rem;
  }
  .tl10f4-subject-name{font-size:.82rem}
  .tl10f4-subject-counts{gap:.25rem}
  .tl10f4-subject-counts span{
    padding:.18rem .35rem;
    font-size:.60rem;
  }
  .tl10f4-subject-actions{
    display:grid;
    grid-template-columns:1fr;
  }
  .tl10f4-subject-actions .btn{
    width:100%;
    min-height:34px!important;
    font-size:.68rem!important;
  }
  .tl10f4-profile-grid{grid-template-columns:1fr}
  .tl10f4-history-head{
    margin-bottom:.55rem!important;
  }
  .tl10f4-history-head .tl-page-subtitle{
    font-size:.72rem!important;
  }
  .tl10f4-history-controls{
    display:grid;
    gap:.55rem;
  }
  .tl10f4-range-pills{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    width:100%;
  }
  .tl10f4-range-pills button{
    min-width:0;
    padding:.4rem .25rem;
    font-size:.7rem;
  }
  .tl10f4-advanced-filter{
    width:100%;
  }
  .tl10f4-advanced-filter summary{
    width:100%;
    justify-content:center;
  }
  .tl10f4-advanced-filter-body{
    position:static;
    width:100%;
    margin-top:.4rem;
    grid-template-columns:1fr 1fr;
  }
  .tl10f4-advanced-filter-body .btn{
    grid-column:1/3;
    width:100%;
  }
  .tl10f4-history-table-head{
    display:grid!important;
    gap:.7rem!important;
  }
  .tl10f4-history-tools{
    width:100%;
    display:grid;
    grid-template-columns:1fr auto;
  }
  .tl10f4-history-search input{
    width:100%;
  }
  .tl10f4-history-mobile{
    display:grid;
    gap:.65rem;
    padding:.75rem;
  }
  .tl10f4-history-mobile .tl8e-history-row{
    margin:0!important;
  }
  .tl10f4-pagination{
    padding:.75rem;
  }
  .tl-resource-panel{
    width:min(100vw,100%)!important;
  }
  .tl10f4-live-pdf-stage{
    min-height:55vh;
    padding:.4rem;
  }
  .tl10f4-live-pdf-toolbar .btn{
    min-height:34px!important;
    padding:.3rem .45rem!important;
    font-size:.68rem!important;
  }
}
