/* ══════════════════════════════════════════════
   TUTORIAL PAGE
   Loaded after home_page.css (top bar + footer come from there)
══════════════════════════════════════════════ */

.tut-page {
  --tut-navy:  #034ea2;
  --tut-blue:  #007bff;
  --tut-ink:   #1a1a2e;
  --tut-muted: #666;
  --tut-line:  #e3e8ef;
  --tut-stage: #0e1a2b;
}

/* Active nav link */
.top-nav-links a.active {
  color: var(--tut-blue);
  box-shadow: inset 0 -2px 0 var(--tut-blue);
}

/* ------------------------------ */
/*  Header                       */
/* ------------------------------ */
.tut-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 20px 12px;
  margin-bottom: 0;
}

.tut-header-logo img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
}

.tut-header h1 {
  font-size: 2rem;
  line-height: 1.1;
  color: var(--tut-ink);
}

.tut-header p {
  color: var(--tut-muted);
  margin-top: 4px;
  max-width: 62ch;
  line-height: 1.5;
}

/* ------------------------------ */
/*  Layout                       */
/* ------------------------------ */
.tut-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  padding: 8px 20px 28px;
  align-items: start;
}

/* ------------------------------ */
/*  Player                       */
/* ------------------------------ */
.tut-player-frame {
  background: var(--tut-stage);
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: 0 12px 32px rgba(3, 78, 162, 0.18);
}

.tut-player-frame video {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--tut-stage);
}

.tut-now {
  padding: 14px 4px 0;
}

.tut-now-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.tut-now h2 {
  font-size: 1.35rem;
  color: var(--tut-ink);
}

.tut-duration {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tut-navy);
  background: #e8f1ff;
  border-radius: 999px;
  padding: 2px 10px;
}

.tut-now p {
  color: #555;
  line-height: 1.6;
  margin-top: 6px;
  max-width: 70ch;
}

/* ------------------------------ */
/*  Side panel                   */
/* ------------------------------ */
.tut-side {
  background: #fff;
  border: 1px solid var(--tut-line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 16px;
}

.tut-side-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--tut-muted);
  margin-bottom: 8px;
}

/* Language segmented control */
.tut-lang {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  background: #f1f4f8;
  border-radius: 9px;
}

.tut-lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: 0.92rem;
  color: #444;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tut-lang-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.tut-lang-btn:hover:enabled {
  color: var(--tut-navy);
}

.tut-lang-btn[aria-pressed="true"] {
  background: #fff;
  color: var(--tut-navy);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tut-lang-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Video list */
.tut-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tut-item {
  width: 100%;
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tut-item:hover:enabled {
  background: #f5f8fc;
}

.tut-item[aria-current="true"] {
  background: #eef5ff;
  border-color: #b9d6ff;
}

.tut-item:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.tut-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  overflow: hidden;
  background: var(--tut-stage);
}

.tut-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tut-thumb-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(14, 26, 43, 0.25);
}

.tut-item[aria-current="true"] .tut-thumb-play {
  background: rgba(3, 78, 162, 0.45);
}

.tut-thumb-time {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.72rem;
}

.tut-item-title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--tut-ink);
}

.tut-item-desc {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--tut-muted);
}

.tut-help {
  font-size: 0.85rem;
  color: var(--tut-muted);
  padding-top: 12px;
  border-top: 1px solid #eef1f5;
}

.tut-help a {
  color: var(--tut-blue);
  text-decoration: none;
}

.tut-help a:hover {
  text-decoration: underline;
}

/* Empty state */
.tut-empty {
  margin: 20px;
  padding: 40px 20px;
  text-align: center;
  background: #fff;
  border: 1px dashed #c9d3e0;
  border-radius: 12px;
  color: var(--tut-muted);
}

.tut-empty a {
  display: inline-block;
  margin-top: 10px;
  color: var(--tut-blue);
}

/* Keyboard focus */
.tut-item:focus-visible,
.tut-lang-btn:focus-visible,
.tut-header-logo:focus-visible {
  outline: 3px solid rgba(0, 123, 255, 0.45);
  outline-offset: 2px;
}

/* ------------------------------ */
/*  Responsive                   */
/* ------------------------------ */
@media (max-width: 900px) {
  .tut-layout {
    grid-template-columns: 1fr;
  }

  .tut-side {
    position: static;
  }
}

@media (max-width: 768px) {
  .tut-header {
    padding: 12px;
    gap: 12px;
  }

  .tut-header-logo img {
    width: 52px;
    height: 52px;
  }

  .tut-header h1 {
    font-size: 1.6rem;
  }

  .tut-header p {
    font-size: 0.9rem;
  }

  .tut-layout {
    padding: 4px 12px 20px;
    gap: 16px;
  }

  .tut-player-frame {
    border-radius: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tut-item,
  .tut-lang-btn {
    transition: none;
  }
}

/* ------------------------------ */
/*  Home button                  */
/* ------------------------------ */
.tut-page .top-bar {
  gap: 20px;
}

.tut-page .top-nav-links {
  flex: 1;
  min-width: 0;
}

.tut-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--tut-navy);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.tut-home-btn:hover {
  background: var(--tut-blue);
}

.tut-home-btn:focus-visible {
  outline: 3px solid rgba(0, 123, 255, 0.45);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .tut-page .top-bar {
    gap: 10px;
  }

  .tut-home-btn {
    padding: 7px 12px;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tut-home-btn {
    transition: none;
  }
}
