@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Inter:wght@400;500;700&display=swap');

:root {
  --bg-color: #0d0d0d;
  --bg-deep: #080808;
  --surface-color: #1e1e1e;
  --card-bg: #161616;
  --primary-color: #FFC107;
  --secondary-color: #ffca28;
  --accent-glow: rgba(255, 193, 7, .35);
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --glass-border: #2a2a2a;
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --transition: all 0.3s ease;
  --nav-height: 68px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 700;
}

a { color: inherit; }

/* ══════════════════════════════════════════════════════════════
   STICKY NAV
   ══════════════════════════════════════════════════════════════ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 500;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  background: rgba(8, 8, 8, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary-color);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.nav-brand-text strong {
  font-family: 'Poppins', sans-serif;
  font-size: 1.05rem;
  letter-spacing: .5px;
  color: var(--text-primary);
}

.nav-brand-text small {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--primary-color);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin: 0 auto;
}

.nav-links a {
  position: relative;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: .88rem;
  font-weight: 600;
  padding: 6px 2px;
  transition: color .2s;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--text-primary); }

.nav-links a.active { color: var(--primary-color); }

.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--primary-color);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-glow);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

.nav-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  font-size: .95rem;
  transition: var(--transition);
}

.nav-icon-btn:hover {
  color: var(--primary-color);
  background: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.3);
}

.nav-hamburger {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}

.nav-search-bar {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  display: none;
  align-items: center;
  gap: .75rem;
  padding: .85rem clamp(1rem, 3vw, 2.5rem);
  background: rgba(8, 8, 8, 0.97);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  animation: fadeIn .2s ease-out;
}

.nav-search-bar.open { display: flex; }

.nav-search-bar i.fa-magnifying-glass:first-child { color: var(--text-secondary); }

.nav-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: .95rem;
  font-family: inherit;
}

.nav-search-bar input::placeholder { color: var(--text-secondary); }

.nav-search-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
}

/* ══════════════════════════════════════════════════════════════
   CINEMATIC HERO
   ══════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  background: linear-gradient(to right, rgba(8,8,8,.95) 20%, rgba(8,8,8,.55) 60%, rgba(8,8,8,.25) 100%), var(--bg-deep);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8,8,8,1) 0%, rgba(8,8,8,0) 35%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem);
  animation: fadeInUp .7s ease-out backwards;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-color);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(1.9rem, 4.2vw, 3.1rem);
  font-weight: 800;
  line-height: 1.15;
  max-width: 650px;
  color: var(--text-primary);
  text-shadow: 0 4px 24px rgba(0,0,0,.5);
  margin-bottom: 1.1rem;
}

.hero-desc {
  max-width: 620px;
  color: var(--text-secondary);
  font-size: .98rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.hero-dev {
  color: var(--text-secondary);
  font-size: .85rem;
  margin-bottom: 1.5rem;
}

.hero-dev strong { color: var(--text-primary); }

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1.75rem;
}

.hero-pill {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 193, 7, 0.4);
  background: rgba(255, 193, 7, 0.08);
  color: var(--primary-color);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .6px;
  text-decoration: none;
  transition: var(--transition);
}

.hero-pill:hover {
  background: var(--primary-color);
  color: #000;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
}

.hero-cta-primary, .hero-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 8px;
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.hero-cta-primary {
  background: var(--primary-color);
  color: #000;
  box-shadow: 0 8px 24px rgba(255, 193, 7, 0.25);
}

.hero-cta-primary:hover {
  background: #ffd24d;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 193, 7, 0.35);
}

.hero-cta-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.18);
}

.hero-cta-secondary:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.35);
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════════
   SUBJECT DETAIL "hero-lite"
   ══════════════════════════════════════════════════════════════ */
.subject-hero-lite {
  padding: 2rem 0 .5rem;
  animation: fadeInUp .5s ease-out;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  padding: 9px 18px;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: .85rem;
  transition: var(--transition);
}

.back-link:hover {
  background: var(--primary-color);
  color: #000;
  border-color: var(--primary-color);
}

.subject-title {
  margin-top: 1.25rem;
  color: var(--text-primary);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.subject-title::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 1.8rem;
  background: var(--primary-color);
  margin-right: 14px;
  vertical-align: -3px;
  border-radius: 2px;
  box-shadow: 0 0 10px var(--accent-glow);
}

.subject-count {
  margin-top: .5rem;
  color: var(--text-secondary);
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.subject-count i { color: var(--primary-color); }

.subject-disclaimer {
  margin-top: 1.25rem;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: .88rem;
  text-align: justify;
  max-width: 900px;
  border-left: 2px solid var(--glass-border);
  padding-left: 1rem;
}

/* ══════════════════════════════════════════════════════════════
   STREAMING CAROUSEL ROWS
   ══════════════════════════════════════════════════════════════ */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem) 1rem;
}

.carousel-section {
  padding: 1.75rem 0;
  scroll-margin-top: calc(var(--nav-height) + 12px);
}

.carousel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0 clamp(1rem, 3vw, 2rem);
  margin-left: calc(-1 * clamp(1rem, 3vw, 2rem));
  margin-right: calc(-1 * clamp(1rem, 3vw, 2rem));
}

.carousel-head h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--text-primary);
}

.carousel-accent {
  display: inline-block;
  width: 5px;
  height: 1.3rem;
  background: var(--primary-color);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--accent-glow);
}

.carousel-view-all {
  color: var(--primary-color);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity .2s;
}

.carousel-view-all:hover { opacity: .75; }

.carousel-row {
  position: relative;
  display: flex;
  align-items: center;
}

.carousel-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  padding: .35rem clamp(1rem, 3vw, 2rem) 1.25rem;
  margin: 0 calc(-1 * clamp(1rem, 3vw, 2rem));
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.carousel-track::-webkit-scrollbar { height: 7px; }
.carousel-track::-webkit-scrollbar-track { background: transparent; }
.carousel-track::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }
.carousel-track::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

.carousel-arrow {
  display: none;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(13,13,13,0.85);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: var(--transition);
}

@media (min-width: 900px) {
  .carousel-arrow { display: flex; }
  .carousel-arrow-left { margin-right: -21px; }
  .carousel-arrow-right { margin-left: -21px; }
}

.carousel-arrow:hover {
  background: var(--primary-color);
  color: #000;
  border-color: var(--primary-color);
}

.carousel-empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
  width: 100%;
}

/* ══════════════════════════════════════════════════════════════
   RESOURCE / SUBJECT CARDS (streaming style)
   ══════════════════════════════════════════════════════════════ */
.project-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s ease, border-color .3s ease;
  position: relative;
  cursor: pointer;
  animation: fadeIn 0.6s ease-out backwards;
  text-decoration: none;
  display: block;
}

.carousel-card {
  flex: 0 0 auto;
  width: clamp(230px, 22vw, 280px);
  scroll-snap-align: start;
}

.project-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 18px 40px rgba(0,0,0,.55), 0 0 0 1px var(--accent-glow), 0 0 28px var(--accent-glow);
  border-color: var(--primary-color);
  z-index: 2;
}

.card-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--primary-color);
  position: relative;
  overflow: hidden;
}

.card-thumbnail::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.75) 100%);
}

.play-icon {
  position: relative;
  z-index: 2;
  transition: var(--transition);
}

.project-card:hover .play-icon {
  transform: scale(1.15);
  color: var(--primary-color);
}

.card-content {
  padding: 1rem 1.1rem 1.1rem;
  position: relative;
  z-index: 2;
}

.project-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .4rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-description {
  font-size: .8rem;
  color: var(--text-secondary);
  margin-bottom: .6rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .5rem;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  color: var(--primary-color);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}

.card-views {
  font-size: .75rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.card-subtext {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: .78rem;
  color: var(--text-secondary);
  margin-bottom: .6rem;
}

.card-subtext span { display: flex; align-items: center; gap: 6px; }
.card-subtext i { color: var(--primary-color); width: 14px; }

.project-subject, .project-owners {
  font-size: .85rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-subject i, .project-owners i {
  color: var(--primary-color);
  width: 16px;
}

.video-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  opacity: 0.8;
  transition: transform .4s ease, opacity .3s ease;
}

.project-card:hover .video-preview-img {
  opacity: 1;
  transform: scale(1.08);
}

.play-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  background: rgba(0,0,0,0.25);
  opacity: 0;
  transition: opacity .25s ease;
}

.project-card:hover .play-overlay { opacity: 1; }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: .75rem;
}

.action-btn {
  flex: 1 1 auto;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  min-width: 0;
  height: 36px;
  padding: 0 .75rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: .78rem;
  font-weight: 700;
  font-family: inherit;
  white-space: nowrap;
}

.action-btn:hover {
  background: var(--primary-color);
  color: #000;
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid rgba(255, 193, 7, 0.18);
  background: var(--bg-deep);
  padding: 2rem clamp(1rem, 3vw, 2.5rem);
  margin-top: 2rem;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: .85rem;
}

.footer-brand strong { color: var(--text-primary); font-family: 'Poppins', sans-serif; }

.footer-dev {
  color: var(--text-secondary);
  font-size: .82rem;
}

.footer-dev strong { color: var(--text-primary); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .site-nav.menu-open .nav-links {
    display: flex;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(8,8,8,0.98);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: .5rem 1.25rem 1rem;
  }
  .site-nav.menu-open .nav-links a { padding: .65rem 0; width: 100%; }
  .hero { min-height: 360px; }
  .hero-ctas { width: 100%; }
  .hero-cta-primary, .hero-cta-secondary { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 600px) {
  .carousel-card { width: 72vw; }
  .hero { min-height: 320px; }
  .hero-title { font-size: 1.7rem; }
}

/* Modal Viewer */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  width: 90%;
  max-width: 1200px;
  height: 85vh;
  background: var(--bg-color);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  position: relative;
  transform: scale(0.95);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 1rem 2rem;
  background: rgba(31, 40, 51, 0.8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.close-btn:hover {
  color: #ff4757;
  transform: rotate(90deg);
}

.modal-body {
  flex: 1;
  width: 100%;
  position: relative;
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.admin-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: var(--primary-color);
  color: #000;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transition: var(--transition);
  z-index: 90;
}

.admin-fab:hover {
  transform: translateY(-5px);
  background: #e0a800;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface-color);
  border: 1px solid var(--primary-color);
  color: var(--text-primary);
  padding: 1rem 2rem;
  border-radius: 30px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: var(--transition);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Animations */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stagger card animations */
.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }
.project-card:nth-child(7) { animation-delay: 0.7s; }

/* Responsive */
@media (max-width: 768px) {
  h1.gallery-title {
    font-size: 2rem;
  }
  .header-content {
    padding: 1.5rem;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}


/* ── Video player tools: rotate, fullscreen, subtitles ── */
.modal-body { overflow: hidden; min-height: 0; }
.player-stage { position: absolute; inset: 0; overflow: hidden; background: #000; }
.player-rot { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: center center; transition: transform .25s ease; }
.player-rot iframe { width: 100%; height: 100%; border: none; display: block; }
.sub-overlay { position: absolute; left: 0; right: 0; bottom: 14%; text-align: center; pointer-events: none; padding: 0 6%; z-index: 2; }
.sub-overlay span { display: inline-block; background: rgba(0,0,0,.72); color: #fff; padding: .2em .55em; border-radius: 4px; font-size: clamp(14px, 2.4vw, 26px); line-height: 1.35; max-width: 100%; white-space: pre-line; text-shadow: 0 1px 2px #000; }

.player-tools { flex: 0 0 auto; background: linear-gradient(180deg, #1b232e, #151b24); border-top: 1px solid var(--glass-border); padding: .6rem .9rem .7rem; display: flex; flex-direction: column; gap: .5rem; }
.pt-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pt-group { display: inline-flex; align-items: center; gap: 2px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 3px; }
.pt-group.pt-grow { flex: 1 1 260px; min-width: 0; }
.pt-btn { appearance: none; background: transparent; color: #e8edf3; border: 0; border-radius: 8px; height: 34px; min-width: 34px; padding: 0 .7rem; font-size: .82rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; text-decoration: none; font-family: inherit; line-height: 1; white-space: nowrap; transition: background .15s, color .15s; }
.pt-btn i { font-size: .95rem; }
.pt-btn:hover { background: rgba(255,255,255,.1); }
.pt-btn:focus-visible, .pt-select:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 1px; }
.pt-btn.on { background: var(--primary-color); color: #000; }
.pt-btn.pt-primary { background: var(--primary-color); color: #000; }
.pt-btn.pt-primary:hover { filter: brightness(1.08); }
.pt-time { min-width: 4.6rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; background: rgba(0,0,0,.35); color: #fff; }
.pt-select { appearance: none; -webkit-appearance: none; background: rgba(0,0,0,.35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23aab4c0'/%3E%3C/svg%3E") no-repeat right .6rem center; color: #fff; border: 0; border-radius: 8px; height: 34px; padding: 0 1.9rem 0 .7rem; font-size: .82rem; font-family: inherit; min-width: 0; flex: 1 1 120px; max-width: 220px; }
.pt-help { font-size: .72rem; color: var(--text-secondary); line-height: 1.4; }
.modal-content:fullscreen { width: 100vw; height: 100vh; max-width: none; border-radius: 0; transform: none; }
.modal-content:-webkit-full-screen { width: 100vw; height: 100vh; max-width: none; border-radius: 0; transform: none; }

@media (max-width: 700px) {
  .modal-content { width: 96%; height: 92vh; border-radius: 14px; }
  .modal-header { padding: .65rem .9rem; }
  .modal-title { font-size: 1rem; }
  .player-tools { padding: .5rem .55rem .6rem; gap: .4rem; }
  .pt-row { gap: .4rem; }
  .pt-btn span { display: none; }
  .pt-btn.pt-primary span, .pt-btn.pt-labeled span { display: inline; }
  .pt-btn { min-width: 38px; height: 38px; padding: 0 .55rem; }
  .pt-select { height: 38px; }
  .pt-group.pt-sync { width: 100%; justify-content: space-between; }
  .pt-group.pt-sync .pt-btn { flex: 1 1 0; padding: 0 .3rem; }
  .pt-group.pt-sync .pt-btn.pt-primary { flex: 2.2 1 0; }
  .pt-group.pt-sync .pt-time { flex: 1.5 1 0; }
  .pt-help { display: none; }
}

/* Fullscreen fallback for browsers (iPhone) that only allow native fullscreen on <video> */
.pfs-exit { display: none; position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: 10px; z-index: 6; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 1.1rem; align-items: center; justify-content: center; cursor: pointer; }
.modal-content.pseudo-fs { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; border-radius: 0; border: 0; transform: none; z-index: 3000; }
.modal-content.pseudo-fs .modal-header { display: none; }
.modal-content.pseudo-fs .pfs-exit { display: flex; }
.modal-content.pseudo-fs .pt-help { display: none; }
.modal-content.pseudo-fs .player-tools { padding-bottom: calc(.6rem + env(safe-area-inset-bottom, 0px)); }
html.pseudo-fs-lock, html.pseudo-fs-lock body { overflow: hidden; }
@media (max-width: 700px) {
  .modal-content { height: 92vh; height: 92dvh; }
}

/* Mobile fullscreen: video only — controls hidden, just a small restore icon (top right) */
.modal-content.pseudo-fs .player-tools { display: none !important; }
.modal-content.pseudo-fs .pfs-exit { width: 40px; height: 40px; font-size: 1rem; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.25); z-index: 10; }

/* ── Mobile toolbar: subtitle controls collapse behind one button ── */
.pt-subtoggle { display: none; }
@media (max-width: 700px) {
  .pt-subtoggle { display: inline-flex; margin-left: auto; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
  .pt-subtoggle span { display: inline; }
  .pt-subtoggle .pt-chev { font-size: .7rem; transition: transform .2s; }
  .pt-subtoggle.on .pt-chev { transform: rotate(180deg); }
  .player-tools .pt-subpart { display: none; }
  .player-tools.pt-subs-open .pt-subpart { display: flex; }
  .player-tools.pt-subs-open .pt-group.pt-subpart { width: 100%; }
  .pt-group.pt-grow { flex: 1 1 100%; }
  .pt-select { max-width: none; flex: 1 1 0; }

  /* sync row: big Start/Pause on its own line, nudges evenly below */
  .pt-group.pt-sync { flex-wrap: wrap; row-gap: 3px; }
  .pt-group.pt-sync .pt-btn.pt-primary { flex: 1 1 100%; height: 42px; font-size: .9rem; }
  .pt-group.pt-sync .pt-btn { flex: 1 1 0; min-width: 0; }
  .pt-group.pt-sync .pt-time { flex: 1.6 1 0; }

  /* compact header: hide the course/subject line, keep name + change link */
  #activeWatcherMeta { display: none; }
  #watcherInfoBar { font-size: .72rem !important; }
}

/* ── Mobile: smaller toolbar + scaled-down Drive player so its own controls are less bulky ── */
@media (max-width: 700px) {
  .player-tools { padding: .4rem .5rem .5rem; gap: .3rem; }
  .pt-row { gap: .3rem; }
  .pt-btn { height: 32px; min-width: 32px; padding: 0 .5rem; font-size: .74rem; border-radius: 7px; }
  .pt-btn i { font-size: .82rem; }
  .pt-select { height: 32px; font-size: .74rem; }
  .pt-group { border-radius: 9px; padding: 2px; }
  .pt-group.pt-sync .pt-btn.pt-primary { height: 34px; font-size: .8rem; }
  .pt-subtoggle { padding: 0 .55rem; }
  .pt-help { display: none; }
  .player-rot iframe { width: 140%; height: 140%; transform: scale(.7143); transform-origin: 0 0; }
}

/* ── Minimal player controls: just rotate + fullscreen, tucked in the video's top-left corner ── */
.player-mini { position: absolute; top: 10px; left: 10px; z-index: 6; gap: 6px; }
.pm-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,.22); background: rgba(0,0,0,.5); color: #fff; font-size: .85rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; opacity: .75; transition: opacity .15s, background .15s; }
.pm-btn:hover, .pm-btn:focus-visible { opacity: 1; background: rgba(0,0,0,.75); outline: none; }
.modal-content.pseudo-fs .player-mini { display: none !important; }
@media (max-width: 700px) { .pm-btn { width: 32px; height: 32px; } }

/* Hides Google Drive's "open in new window" button (top-right of its player) so the video is watched on this site */
.drive-popout-block { display: none; position: absolute; top: 0; right: 0; width: 76px; height: 68px; background: #000; z-index: 4; }


/* ══════════════════════════════════════════════════════════════
   SUBJECT PAGE: file search box + "gallery" (scroll-down) layout
   ══════════════════════════════════════════════════════════════ */
.file-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  margin: 1.1rem 0 .25rem;
  padding: 0 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  transition: var(--transition);
}
.file-search:focus-within { border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--accent-glow); }
.file-search > i { color: var(--text-secondary); }
.file-search input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text-primary);
  font-size: .95rem;
  font-family: inherit;
}
.file-search input::-webkit-search-cancel-button { display: none; }
.file-search-clear { background: none; border: 0; color: var(--text-secondary); cursor: pointer; padding: 4px; }
.file-search-clear:hover { color: var(--primary-color); }
.file-search-count { color: var(--text-secondary); font-size: .78rem; white-space: nowrap; }

/* Gallery layout: cards wrap into rows and the page scrolls down. */
.carousel-track.is-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.5rem 1.25rem;
  overflow-x: visible;
  scroll-snap-type: none;
  margin: 0;
  padding: .75rem 0 1.5rem;
}
.carousel-track.is-gallery > .carousel-card { width: auto; }
@media (max-width: 600px) {
  .carousel-track.is-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem .75rem; }
}
@media (max-width: 380px) {
  .carousel-track.is-gallery { grid-template-columns: minmax(0, 1fr); }
}
