/* ============================================================
   PHONLAB — Student CSS
   Mobile-first styles for student views.
   Loaded in addition to tokens.css + components.css.
   ============================================================ */

/* ── Student Layout ──────────────────────────────────────── */
.s-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--body-bg);
  color: var(--body-color);
}

/* ── Student Sidebar ─────────────────────────────────────── */
.s-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--t-base);
}

.s-sidebar-brand {
  padding: var(--gap-lg) var(--gap-md) var(--gap-md);
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}

.s-brand-logo {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.s-brand-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Live Session Block ──────────────────────────────────── */
.live-session-block {
  margin: var(--gap-sm) var(--gap-sm) 0;
  display: none;
}

.live-session-block.visible { display: block; }

.live-card {
  background: var(--status-active-bg);
  border: 1px solid var(--status-active-border);
  border-radius: 10px;
  padding: var(--gap-sm) var(--gap-md);
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: background var(--t-fast), border-color var(--t-fast);
}

.live-card:hover {
  background: rgba(110,231,183,0.20);
  border-color: rgba(110,231,183,0.55);
}

.live-badge {
  display: flex;
  align-items: center;
  gap: var(--gap-xs);
  margin-bottom: var(--gap-xs);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-active-color);
  box-shadow: 0 0 0 3px rgba(110,231,183,0.20);
  flex-shrink: 0;
  animation: livePulse 1.6s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(110,231,183,0.20); }
  50%       { opacity: 0.6; box-shadow: 0 0 0 5px rgba(110,231,183,0.08); }
}

.live-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--status-active-color);
}

.live-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: var(--gap-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-join-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-xs);
  width: 100%;
  padding: 6px 0;
  border-radius: 7px;
  background: rgba(110,231,183,0.20);
  border: 1px solid rgba(110,231,183,0.40);
  color: rgba(167,243,208,0.95);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-fast);
}

.live-join-btn:hover { background: rgba(110,231,183,0.32); }

/* No live session */
.no-live-block {
  margin: var(--gap-sm);
  padding: var(--gap-sm) var(--gap-md);
  border-radius: 10px;
  border: 1px dashed var(--divider);
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

.waiting-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(251,191,36,0.70);
  flex-shrink: 0;
  animation: livePulse 2s ease-in-out infinite;
}

.no-live-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Student Nav ─────────────────────────────────────────── */
.s-nav {
  flex: 1;
  padding: var(--gap-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.s-nav-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-label);
  padding: var(--gap-sm) var(--gap-sm) var(--gap-xs);
}

.s-nav-item {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: 8px var(--gap-sm);
  border-radius: 8px;
  font-size: var(--text-md);
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background var(--t-fast), color var(--t-fast);
}

.s-nav-item:hover {
  background: var(--sidebar-item-hover);
  color: var(--text-primary);
}

.s-nav-item.active {
  background: var(--sidebar-item-active-bg);
  color: var(--sidebar-item-active-color);
}

.s-nav-item .icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Student Sidebar Footer ──────────────────────────────── */
.s-sidebar-footer {
  padding: var(--gap-md);
  border-top: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  flex-shrink: 0;
}

.s-footer-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.s-signout {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-decoration: none;
  flex-shrink: 0;
  transition: color var(--t-fast);
}

.s-signout:hover { color: var(--text-secondary); }

/* ── Student Main ────────────────────────────────────────── */
.s-main {
  flex: 1;
  overflow-y: auto;
  padding: var(--gap-lg);
  min-width: 0;
}

.s-main-heading {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.s-main-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--gap-lg);
}

/* ── Student Bottom Nav (mobile) ─────────────────────────── */
.s-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--header-bg);
  border-top: 1px solid var(--header-border);
  z-index: var(--z-header);
  align-items: center;
  justify-content: space-around;
  padding: 0 var(--gap-md);
}

.s-bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  padding: var(--gap-xs) var(--gap-sm);
  border-radius: 8px;
  transition: color var(--t-fast);
}

.s-bottom-nav__item.active { color: var(--accent-light); }
.s-bottom-nav__item .icon  { font-size: 20px; }

/* ── Activity View ───────────────────────────────────────── */
.activity-shell {
  min-height: 100vh;
  background: var(--body-bg);
  color: var(--body-color);
  display: flex;
  flex-direction: column;
}

.activity-header {
  padding: var(--gap-md) var(--gap-lg);
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  flex-shrink: 0;
}

.activity-body {
  flex: 1;
  padding: var(--gap-lg);
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

/* ── Mobile overrides ────────────────────────────────────── */
@media (max-width: 600px) {
  .s-sidebar {
    display: none;
  }

  .s-main {
    padding: var(--gap-md);
    padding-bottom: 70px; /* space for bottom nav */
  }

  .s-bottom-nav {
    display: flex;
  }

  .activity-body {
    padding: var(--gap-md);
  }
}

/* ── Tablet overrides ────────────────────────────────────── */
@media (min-width: 601px) and (max-width: 900px) {
  .s-sidebar {
    width: 56px;
  }

  .s-sidebar .s-nav-item span:not(.icon),
  .s-sidebar .s-nav-label,
  .s-sidebar .s-brand-sub,
  .s-sidebar .s-footer-name,
  .s-sidebar .live-title,
  .s-sidebar .live-join-btn,
  .s-sidebar .no-live-text {
    display: none;
  }

  .s-sidebar .s-sidebar-brand {
    padding: var(--gap-sm);
    text-align: center;
  }

  .s-sidebar .s-brand-logo {
    font-size: var(--text-sm);
  }
}
