/*
 * MyTime – lekcje wideo. Everything is scoped to #mytime-lekcje so the styles
 * neither leak into the WordPress page nor get overridden by the theme/Elementor.
 */
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap");

/* MyTime palette, sampled from mytime.edu.pl */
#mytime-lekcje {
  --navy: #141c7a;
  --navy-dark: #0e1459;
  --navy-light: #232d9a;
  --red: #e70000;
  --red-dark: #c40000;
  --purple: #6700cd;
  --yellow: #ffdc7c;
  --green: #0ba350;
  --ink: #201e25;
  --muted: #6a7081;
  --bg: #f7f8fd;
  --card: #ffffff;
  --line: #e4e6f0;
  --radius: 12px;
  --sidebar-w: 300px;
  --sticky-top: 24px; /* raise if the site's sticky header covers the lesson list */

  font-family: Montserrat, system-ui, sans-serif;
  font-size: 16px;
  color: var(--ink);
  line-height: 1.6;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  scroll-margin-top: 100px;
}

/* Neutralise common theme styles inside the app */
#mytime-lekcje *, #mytime-lekcje *::before, #mytime-lekcje *::after { box-sizing: border-box; }
#mytime-lekcje [hidden] { display: none !important; }
#mytime-lekcje p { margin: 0 0 1em; padding: 0; font-size: inherit; line-height: inherit; color: inherit; font-family: inherit; }
#mytime-lekcje ul { list-style: none; margin: 0; padding: 0; }
#mytime-lekcje li { margin: 0; padding: 0; }
#mytime-lekcje li::before, #mytime-lekcje li::marker { content: none; }
#mytime-lekcje a { text-decoration: none; box-shadow: none; }
#mytime-lekcje img { max-width: 100%; height: auto; border: 0; box-shadow: none; border-radius: 0; }
#mytime-lekcje iframe { margin: 0; max-width: none; }
#mytime-lekcje button, #mytime-lekcje input {
  font: inherit; letter-spacing: normal; text-transform: none; text-shadow: none;
  box-shadow: none; margin: 0; min-height: 0; line-height: 1.4;
}
#mytime-lekcje .mt-h {
  font-family: inherit; font-weight: 800; line-height: 1.2; letter-spacing: normal;
  text-transform: none; color: var(--navy); margin: 0 0 20px; padding: 0;
}
#mytime-lekcje .mt-muted { color: var(--muted); }

/* Buttons */
#mytime-lekcje .mt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 15px; line-height: 1.3;
  padding: 12px 22px; border-radius: var(--radius);
  border: 2px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, transform .05s;
}
#mytime-lekcje .mt-btn:active { transform: translateY(1px); }
#mytime-lekcje .mt-btn:disabled { opacity: .7; cursor: wait; }
#mytime-lekcje .mt-btn:focus-visible, #mytime-lekcje a:focus-visible,
#mytime-lekcje summary:focus-visible, #mytime-lekcje input:focus-visible,
#mytime-lekcje .mt-menu-btn:focus-visible {
  outline: 3px solid var(--yellow); outline-offset: 2px;
}
#mytime-lekcje .mt-btn-primary { background: var(--red); color: #fff; }
#mytime-lekcje .mt-btn-primary:hover { background: var(--red-dark); color: #fff; }
#mytime-lekcje .mt-btn-outline { background: var(--card); color: var(--navy); border-color: var(--line); }
#mytime-lekcje .mt-btn-outline:hover { border-color: var(--navy); color: var(--navy); background: var(--card); }
#mytime-lekcje .mt-btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); width: 100%; }
#mytime-lekcje .mt-btn-ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; color: #fff; }

/* Loading */
#mytime-lekcje .mt-loading { padding: 80px 16px; text-align: center; }

/* Login */
#mytime-lekcje .mt-login {
  display: grid; place-items: center; padding: 56px 16px; border-radius: 24px;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,220,124,.55) 0 90px, transparent 91px),
    radial-gradient(circle at 88% 85%, rgba(103,0,205,.12) 0 140px, transparent 141px),
    var(--bg);
}
#mytime-lekcje .mt-login-card {
  width: 100%; max-width: 420px; background: var(--card);
  border-radius: 20px; padding: 40px 32px;
  box-shadow: 0 20px 50px rgba(20,28,122,.12);
  text-align: center;
}
#mytime-lekcje .mt-login-logo { width: 180px; margin: 0 auto 16px; display: block; }
#mytime-lekcje .mt-login-card .mt-h { font-size: 24px; margin-bottom: 8px; }
#mytime-lekcje .mt-login-form { text-align: left; margin-top: 24px; display: grid; gap: 10px; }
#mytime-lekcje .mt-login-form label { font-weight: 600; font-size: 14px; color: var(--ink); margin: 0; }
#mytime-lekcje .mt-login-form input {
  width: 100%; height: auto; padding: 12px 14px; border-radius: var(--radius);
  border: 2px solid var(--line); background: var(--bg); color: var(--ink);
}
#mytime-lekcje .mt-login-form input:focus { border-color: var(--navy); outline: none; }
#mytime-lekcje .mt-login-form .mt-btn { margin-top: 8px; width: 100%; }
#mytime-lekcje .mt-form-error { color: var(--red); font-weight: 600; font-size: 14px; margin: 0; }

/* Layout: navy lesson list on the left, player on the right */
#mytime-lekcje .mt-layout { display: flex; align-items: flex-start; gap: 32px; }
#mytime-lekcje .mt-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--navy); color: #fff; border-radius: 20px;
  display: flex; flex-direction: column;
  position: sticky; top: var(--sticky-top);
  max-height: calc(100vh - var(--sticky-top) - 24px); overflow-y: auto;
}
#mytime-lekcje .mt-sidebar-brand { background: #fff; margin: 16px; border-radius: var(--radius); padding: 10px; text-align: center; }
#mytime-lekcje .mt-sidebar-brand img { width: 130px; display: block; margin: 0 auto; }
#mytime-lekcje .mt-sidebar-title {
  margin: 4px 20px 8px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.6);
}
#mytime-lekcje .mt-nav { flex: 1; padding: 0 10px 10px; }
#mytime-lekcje .mt-nav a {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  color: rgba(255,255,255,.88); font-size: 14px; font-weight: 500; line-height: 1.4;
  border-left: 4px solid transparent;
}
#mytime-lekcje .mt-nav a:hover { background: var(--navy-light); color: #fff; }
#mytime-lekcje .mt-nav a.mt-active { background: var(--navy-dark); color: #fff; border-left-color: var(--red); font-weight: 700; }
#mytime-lekcje .mt-check {
  flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px;
  border-radius: 50%; border: 2px solid rgba(255,255,255,.4);
  display: grid; place-items: center; font-size: 11px; line-height: 1;
}
#mytime-lekcje .mt-done .mt-check { background: var(--green); border-color: var(--green); }
#mytime-lekcje .mt-done .mt-check::after { content: "✓"; color: #fff; font-weight: 800; }

#mytime-lekcje .mt-group summary {
  cursor: pointer; list-style: none;
  padding: 10px; margin-top: 6px; border-radius: 10px;
  font-weight: 700; font-size: 14px; color: #fff;
  display: flex; justify-content: space-between; align-items: center;
}
#mytime-lekcje .mt-group summary::-webkit-details-marker { display: none; }
#mytime-lekcje .mt-group summary::after { content: "▸"; transition: transform .15s; color: var(--yellow); }
#mytime-lekcje .mt-group details[open] > summary::after { transform: rotate(90deg); }
#mytime-lekcje .mt-group summary:hover { background: var(--navy-light); }
#mytime-lekcje .mt-group ul { padding-left: 10px; }

#mytime-lekcje .mt-logout { padding: 16px; border-top: 1px solid rgba(255,255,255,.12); }

/* Content */
#mytime-lekcje .mt-content { flex: 1; min-width: 0; }
#mytime-lekcje .mt-eyebrow {
  margin: 0 0 6px; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--purple);
}
#mytime-lekcje .mt-title { font-size: clamp(24px, 3vw, 34px); }
/* 16:9 box via padding (works on older phones too). The !important rules stop
   WordPress themes' mobile iframe rules (e.g. height:auto) from squashing the player. */
#mytime-lekcje .mt-video {
  position: relative; width: 100%; height: 0 !important; padding: 0 0 56.25% !important; margin: 0;
  background: #000; border-radius: 16px; overflow: hidden;
  box-shadow: 0 16px 40px rgba(20,28,122,.15);
}
#mytime-lekcje .mt-video iframe {
  position: absolute !important; top: 0 !important; left: 0 !important; right: auto !important; bottom: auto !important;
  width: 100% !important; height: 100% !important; min-width: 0 !important; min-height: 0 !important;
  max-width: none !important; max-height: none !important;
  margin: 0 !important; padding: 0 !important; border: 0 !important; transform: none !important;
  aspect-ratio: auto !important;
}
#mytime-lekcje .mt-open-video { margin: 10px 0 0; font-size: 14px; }
#mytime-lekcje .mt-open-video a { color: var(--navy); font-weight: 600; text-decoration: underline; }
#mytime-lekcje .mt-lesson-actions { margin: 20px 0; }
#mytime-lekcje .mt-complete-btn .mt-when-on { display: none; }
#mytime-lekcje .mt-complete-btn[aria-pressed="true"] { background: var(--green); }
#mytime-lekcje .mt-complete-btn[aria-pressed="true"] .mt-when-on { display: inline; }
#mytime-lekcje .mt-complete-btn[aria-pressed="true"] .mt-when-off { display: none; }
#mytime-lekcje .mt-description {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px 24px; white-space: pre-line;
}
#mytime-lekcje .mt-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

/* Mobile: the lesson list becomes a drawer opened by "Lista lekcji" */
#mytime-lekcje .mt-topbar { display: none; }
#mytime-lekcje .mt-scrim { display: none; }
@media (max-width: 860px) {
  #mytime-lekcje .mt-topbar { display: block; margin-bottom: 16px; }
  #mytime-lekcje .mt-menu-btn {
    display: inline-flex; align-items: center; gap: 10px;
    background: var(--navy); color: #fff; border: 0; border-radius: var(--radius);
    padding: 12px 18px; font-weight: 700; font-size: 15px; cursor: pointer;
  }
  #mytime-lekcje .mt-burger { display: grid; gap: 4px; }
  #mytime-lekcje .mt-burger span { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; }
  #mytime-lekcje .mt-sidebar {
    position: fixed; z-index: 100001; left: 0; top: 0; height: 100%; max-height: none;
    width: min(85vw, var(--sidebar-w)); border-radius: 0;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  #mytime-lekcje.mt-nav-open .mt-sidebar { transform: none; }
  #mytime-lekcje.mt-nav-open .mt-scrim {
    display: block; position: fixed; inset: 0; z-index: 100000; background: rgba(14,20,89,.45);
  }
  #mytime-lekcje .mt-pager .mt-btn { flex: 1 1 100%; }
  #mytime-lekcje .mt-login-card { padding: 32px 20px; }
}
html.mt-nav-open, html.mt-nav-open body { overflow: hidden; }
