/* ═════════════════════════════════════════════════════════════
   style_patch.css — Skillak v3.0
   احترافي · متجاوب · داكن/فاتح
   ═════════════════════════════════════════════════════════════ */

/* ─── SESSION WAITING ROOM ─── */
.waitov {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #0a0a1a 0%, #0d1a2e 50%, #0a1a14 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  overflow-y: auto;
  padding: 20px;
}

.swr-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  padding: 10px 0 20px;
}

.swr-logo {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.02em;
  margin-bottom: 4px;
}
.swr-logo span { color: var(--amber, #f59e0b); }

.swr-av { position: relative; }
.swr-photo {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,.2);
  box-shadow: 0 0 0 6px rgba(255,255,255,.06);
}
.swr-initials {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  border: 3px solid rgba(255,255,255,.2);
  box-shadow: 0 0 0 6px rgba(255,255,255,.06);
}

.swr-name {
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
  font-family: 'Fraunces', serif;
  margin: 0;
}

.swr-role {
  font-size: .82rem;
  color: rgba(255,255,255,.5);
  margin: 0;
}

.swr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin: 4px 0;
}

.swr-cell {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.swr-ic { font-size: 1.25rem; }
.swr-val {
  font-size: .95rem;
  font-weight: 800;
  color: #fff;
  font-family: 'Fraunces', serif;
}
.swr-lbl {
  font-size: .66rem;
  color: rgba(255,255,255,.45);
}

.swr-note {
  background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .82rem;
  color: rgba(255,255,255,.75);
  width: 100%;
  text-align: start;
  line-height: 1.6;
}

.swr-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.07);
  border-radius: 50px;
  padding: 10px 18px;
  font-size: .84rem;
  color: rgba(255,255,255,.7);
}
.swr-spin {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: var(--teal, #0d6e75);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}

.swr-tip {
  font-size: .74rem;
  color: rgba(255,255,255,.35);
  margin: 0;
}

/* ─── SESSION BAR ENHANCEMENTS ─── */
.sesbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  background: linear-gradient(90deg, #0a0a1a, #0d1a2e);
  position: relative;
  z-index: 10;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-wrap: nowrap;
  gap: 8px;
  overflow: hidden;
}

.ses-countdown {
  font-size: .75rem;
  font-weight: 700;
  color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.07);
  border-radius: 50px;
  padding: 4px 12px;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.1);
  transition: all .3s;
}
.ses-countdown.warning {
  color: var(--amber, #f59e0b);
  background: rgba(245,158,11,.1);
  border-color: rgba(245,158,11,.3);
  animation: pulse-warn 1.5s ease-in-out infinite;
}
.ses-countdown.expired {
  color: #ef4444;
  background: rgba(239,68,68,.1);
  border-color: rgba(239,68,68,.3);
}
@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: .65; }
}

/* ─── SESSION CONTROLS — professional ─── */
.sesctrls {
  background: linear-gradient(180deg, #0d0d1f, #111827);
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  flex-wrap: wrap;
}

.cwrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.cbtn {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s cubic-bezier(.25,.46,.45,.94);
  outline: none;
  position: relative;
}
.cbtn:active { transform: scale(.9); }

.cbtn.on {
  background: rgba(255,255,255,.1);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.cbtn.on:hover { background: rgba(255,255,255,.18); }

.cbtn.off {
  background: rgba(239,68,68,.18);
  box-shadow: 0 0 0 2px rgba(239,68,68,.4);
}

.cbtn.scron {
  background: rgba(245,158,11,.2);
  box-shadow: 0 0 0 2px rgba(245,158,11,.5);
  animation: pulse-scr 2s ease-in-out infinite;
}
@keyframes pulse-scr {
  0%, 100% { box-shadow: 0 0 0 2px rgba(245,158,11,.5); }
  50% { box-shadow: 0 0 0 5px rgba(245,158,11,.15); }
}

.cbtn.end {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 4px 15px rgba(220,38,38,.4);
  width: 56px; height: 56px;
}
.cbtn.end:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 20px rgba(220,38,38,.6);
}

.cbtn.chattog { background: rgba(13,110,117,.2); }
.cbtn.chattog.unread {
  background: rgba(13,110,117,.35);
  box-shadow: 0 0 0 3px var(--teal, #0d6e75);
}

.clbl {
  font-size: .58rem;
  color: rgba(255,255,255,.45);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .cbtn { width: 44px; height: 44px; font-size: 1.15rem; }
  .cbtn.end { width: 48px; height: 48px; }
  .sesctrls { gap: 4px; padding: 8px; }
}

/* ─── ENTER SESSION BUTTON ─── */
.btn-enter-session {
  background: linear-gradient(135deg, #0d6e75, #14b8a6) !important;
  color: #fff !important;
  font-weight: 800 !important;
  letter-spacing: .02em;
  box-shadow: 0 2px 10px rgba(13,110,117,.35);
  animation: pulse-enter 2.5s ease-in-out infinite;
}
@keyframes pulse-enter {
  0%, 100% { box-shadow: 0 2px 10px rgba(13,110,117,.35); }
  50% { box-shadow: 0 2px 18px rgba(13,110,117,.55); }
}

.btn-end-dash {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  color: #fff !important;
  font-weight: 700 !important;
}

.btn-chat-xs {
  background: var(--wa-green, #25d366) !important;
  color: #fff !important;
}

.btn-cancel-xs {
  background: transparent !important;
  color: var(--red, #ef4444) !important;
  border: 1.5px solid var(--red, #ef4444) !important;
  border-radius: var(--rxs, 8px) !important;
}

.bkcard-active {
  border: 1.5px solid rgba(13,110,117,.4) !important;
  background: linear-gradient(135deg, rgba(13,110,117,.04), transparent) !important;
}

.tr-active td { background: rgba(13,110,117,.03); }

/* ─── DUAL DASHBOARD ─── */
.dual-block {
  border-radius: 20px;
  padding: 20px 22px;
  margin-bottom: 16px;
  color: #fff;
}

.student-block {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  box-shadow: 0 6px 24px rgba(59,130,246,.22);
}

.teacher-block {
  background: linear-gradient(135deg, #064e3b 0%, #059669 100%);
  box-shadow: 0 6px 24px rgba(5,150,105,.22);
}

.dual-block-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.dual-block-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.dual-block-title {
  font-weight: 900;
  font-size: 1.05rem;
}

.dual-block-sub {
  font-size: .73rem;
  opacity: .65;
  margin-top: 2px;
}

.dual-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 540px) {
  .dual-stats { grid-template-columns: repeat(2, 1fr); }
  .dual-block { padding: 16px; }
}

.ds-item {
  background: rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}

.ds-val {
  font-size: 1.55rem;
  font-weight: 900;
  font-family: 'Fraunces', serif;
  line-height: 1;
}
.ds-val small { font-size: .65rem; font-weight: 600; opacity: .7; }

.ds-lbl {
  font-size: .65rem;
  opacity: .7;
  margin-top: 5px;
}

.dual-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: .82rem;
  margin-top: 4px;
}

.dual-teacher-info {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: 4px;
}

.dti-badge {
  background: rgba(255,255,255,.14);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: .78rem;
  font-weight: 700;
}

.dti-badge.badge-warn {
  background: rgba(245,158,11,.25);
}

.dti-btn {
  margin-right: auto;
  background: rgba(255,255,255,.16) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.25) !important;
}

/* ─── ADMIN — platform profit hidden from non-admin ─── */
[data-admin-only] { display: none !important; }
body.is-admin [data-admin-only] { display: revert !important; }

/* ─── CROP MODAL FIX ─── */
.crop-modal { max-width: 820px !important; }

#cropResultPreview {
  opacity: 0;
  transition: opacity .3s;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
#cropResultPreview[src] { opacity: 1; }

/* ─── BOOKING MODAL — fee row visibility ─── */
.pline:has(#bkTutorFee),
.pline:has(#bkFee) {
  display: none;
}
body.is-admin .pline:has(#bkTutorFee),
body.is-admin .pline:has(#bkFee) {
  display: flex;
}

/* ─── SESSION CHAT ─── */
.seschat {
  background: #1a1a2e;
  border-right: 1px solid rgba(255,255,255,.07);
  display: flex;
  flex-direction: column;
  width: 300px;
  min-width: 260px;
}

@media (max-width: 640px) {
  .seschat {
    position: absolute;
    inset: 0;
    width: 100%;
    z-index: 30;
    border: none;
  }
}

.seschathdr {
  background: rgba(255,255,255,.04);
  padding: 12px 16px;
  font-size: .86rem;
  font-weight: 700;
  color: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sesmsgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.sesmb {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: .83rem;
  line-height: 1.55;
  word-break: break-word;
}
.sesmb.mine {
  background: var(--teal, #0d6e75);
  color: #fff;
  align-self: flex-end;
  border-bottom-left-radius: 4px;
}
.sesmb.theirs {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.85);
  align-self: flex-start;
  border-bottom-right-radius: 4px;
}

.sesmeta {
  font-size: .65rem;
  opacity: .55;
  margin-top: 3px;
  text-align: end;
}

.sesinp {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,.07);
  background: rgba(0,0,0,.2);
}

.sesinp input {
  flex: 1;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  color: #fff !important;
  border-radius: 10px !important;
  font-size: .84rem;
}
.sesinp input::placeholder { color: rgba(255,255,255,.3) !important; }

/* ─── RESPONSIVE SESSION LAYOUT ─── */
.sesmain {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

#remWrap {
  flex: 1;
  position: relative;
  background: #0a0a1a;
  overflow: hidden;
}

#remVid {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#locWrap {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 140px;
  aspect-ratio: 4/3;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.2);
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  z-index: 15;
  background: #1a1a2e;
  cursor: move;
}

#locVid {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

@media (max-width: 480px) {
  #locWrap { width: 100px; bottom: 8px; right: 8px; }
}

/* ─── ADMIN ROWS ─── */
.adm-chat-btn {
  white-space: nowrap;
}

/* ─── active pill ─── */
.pill.active-pill {
  animation: pulse-active 1.8s ease-in-out infinite;
  background: rgba(16,185,129,.15);
  color: #059669;
  border: 1px solid rgba(16,185,129,.3);
}
@keyframes pulse-active {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}

/* ─── GENERAL RESPONSIVENESS ─── */
@media (max-width: 768px) {
  .dashlay { grid-template-columns: 1fr !important; }
  .swr-grid { grid-template-columns: 1fr 1fr; }

  .sesctrls {
    justify-content: center;
    gap: 8px;
  }

  /* Hide text labels on small screens to save space */
  .clbl { display: none; }
}

@media (max-width: 380px) {
  .cbtn { width: 40px; height: 40px; font-size: 1rem; }
}

/* ─── SCROLL TO REVIEW — smooth ─── */
#revMod .modal {
  animation: slideUp .35s cubic-bezier(.25,.46,.45,.94);
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ─── Star rating accessible ─── */
.sbtn {
  font-size: 2rem;
  color: #d1d5db;
  background: none;
  border: none;
  cursor: pointer;
  transition: color .15s, transform .15s;
  line-height: 1;
}
.sbtn:hover,
.sbtn.lit { color: var(--amber, #f59e0b); }
.sbtn:hover { transform: scale(1.2); }


/* ─── UX / Responsive improvements ─── */
#endBtn,
#endBtn ~ .clbl,
.cwrap:has(#endBtn) {
  display: none !important;
}

.pwa-early-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(10,10,26,.98), rgba(13,110,117,.95));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 16px 44px rgba(0,0,0,.35);
  z-index: 10000;
  color: #fff;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.pwa-early-banner.pwa-banner-soft {
  box-shadow: 0 18px 52px rgba(0,0,0,.42);
}
.pwa-banner-later {
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .navbar {
    padding: 0 16px;
    gap: 10px;
  }
  .nl {
    display: none;
  }
  .hero {
    min-height: auto;
    padding: 28px 16px 40px;
  }
  .hero-grid,
  .footgrid,
  .fr,
  .dual-stats,
  .swr-grid {
    grid-template-columns: 1fr !important;
  }
  .card,
  .cb,
  .ch {
    border-radius: 18px;
  }
  .cb {
    padding: 18px;
  }
  .ch {
    padding: 14px 18px;
  }
  .pwa-early-banner {
    width: calc(100vw - 16px);
    bottom: 8px;
    border-radius: 18px;
    padding: 12px;
    flex-wrap: wrap;
  }
  .pwa-banner-text {
    min-width: 0;
    flex: 1 1 100%;
  }
  .pwa-banner-btn,
  .pwa-banner-later {
    flex: 1 1 160px;
  }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .navbar { height: 60px; }
  .logo { font-size: 1.25rem; }
  .btn { padding: 10px 14px; }
  .btn-sm { padding: 8px 12px; }
  .swr-inner { max-width: 100%; }
  .swr-name { font-size: 1.15rem; }
  .sesbar { padding: 0 10px; }
  .sesctrls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .cwrap { min-width: 0; }
  .pwa-banner-icon { width: 34px; height: 34px; }
  .pwa-banner-title { font-size: .95rem; }
  .pwa-banner-sub { font-size: .74rem; }
}

@media (max-width: 480px) {
  .pwa-early-banner {
    align-items: flex-start;
  }
  .pwa-banner-btn,
  .pwa-banner-later {
    width: 100%;
  }
}


/* ─── Support chat image card ─── */
.support-photo-card .cb {
  padding: 20px;
}
.support-photo-grid {
  display: grid;
  grid-template-columns: 144px 1fr;
  gap: 18px;
  align-items: start;
}
.support-photo-visual {
  position: relative;
  width: 144px;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, #f8fbff, #fff7ec);
  box-shadow: 0 10px 28px rgba(0,0,0,.06);
}
.support-photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.support-photo-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  background: rgba(17,24,39,.82);
  color: #fff;
  backdrop-filter: blur(8px);
}
.support-photo-copy {
  min-width: 0;
}
.support-photo-title {
  font-size: .98rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--ink);
}
.support-photo-desc {
  font-size: .84rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 14px;
}
.support-photo-actions {
  display: grid;
  gap: 12px;
}
.support-photo-field {
  margin-bottom: 0;
}
.support-photo-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.support-photo-msg {
  margin-top: 10px;
}
@media (max-width: 720px) {
  .support-photo-grid {
    grid-template-columns: 1fr;
  }
  .support-photo-visual {
    width: 100%;
    max-width: 220px;
    justify-self: center;
  }
  .support-photo-buttons {
    flex-direction: column;
  }
  .support-photo-buttons .btn {
    width: 100%;
  }
}
