/* -----------------------------------------------------
   GLOBAL
----------------------------------------------------- */

/* Lock page scroll while modal is open */
html.modal-open,
body.modal-open {
  overflow: hidden;
}

/* Variables */
:root {
  --gq-blue: #175c8d;
  --gq-ring: rgba(255, 255, 255, 0.12);

  /* Unified header sizing */
  --gq-header-h-desktop: 220px;
  --gq-header-h-mobile: 140px;
  --gq-header-pad-desktop: 14px 32px;
  --gq-header-pad-mobile: 8px 16px;

  /* Unified logo sizing */
  --gq-logo-max-h-desktop: 92px;
  --gq-logo-max-h-mobile: 56px;
  --gq-logo-max-w: 220px;
}

/* Optional page baseline (safe on dark sites) */
/* body { background:#0a0f24; color:#fff } */


/* -----------------------------------------------------
   MODAL SHELL (full-screen, responsive)
----------------------------------------------------- */

.gq-modal.hidden { display: none; }

.gq-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.75);
}

/* FULL-SCREEN BACKGROUND IMAGE */
.gq-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: #fbecec;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  z-index: 0;
  opacity: 1;
  pointer-events: none;
}

.gq-modal__dialog {
  width: 100vw;
  height: 100vh;
  background: transparent;
  color: #fff;
  overflow: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  backdrop-filter: blur(2px);
  z-index: 1;
}
.gq-modal__dialog::before { content: none; }
.gq-modal__dialog > * { position: relative; z-index: 1; }

/* Close button */
.gq-modal__close {
  position: absolute !important;
  right: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 9999 !important;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #000;
  font-size: 22px;
  line-height: 1;
}

/* Prevent pointer “grabs” on logo/title inside header */
.gq-modal__header .gq-logo,
.gq-modal__header .gq-title {
  pointer-events: none !important;
}


/* -----------------------------------------------------
   UNIFIED HEADER (video + quiz)
----------------------------------------------------- */

.gq-modal__header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center !important;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--gq-header-h-desktop) !important;
  padding: var(--gq-header-pad-desktop) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.gq-modal__header .gq-logo {
  flex: 0 0 auto !important;
  width: auto !important;
  height: auto !important;
  max-height: var(--gq-logo-max-h-desktop) !important;
  max-width: var(--gq-logo-max-w) !important;
  object-fit: contain !important;
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.25));
  margin: 0 !important;
  padding: 0 !important;
}

/* Remove any oversized “builder/last-of-type” variants */
.gq-modal__header .gq-logo:last-of-type,
.gq-modal__header .gq-logo.builder {
  max-height: var(--gq-logo-max-h-desktop) !important;
  max-width: var(--gq-logo-max-w) !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Title unified */
.gq-title {
  margin: 0 !important;
  flex: 1;
  text-align: center;
  font-weight: 700;
  line-height: 1.2 !important;
  font-size: clamp(18px, 2.2vw, 28px) !important;
}

/* Mobile header */
@media (max-width: 768px) {
  .gq-modal__header {
    min-height: var(--gq-header-h-mobile) !important;
    padding: var(--gq-header-pad-mobile) !important;
  }
  .gq-modal__header .gq-logo {
    max-height: var(--gq-logo-max-h-mobile) !important;
  }
  .gq-modal__close {
    width: 30px;
    height: 30px;
    font-size: 18px;
    right: 10px;
    background: #fff !important;
    color: #000 !important;
  }
}


/* -----------------------------------------------------
   LEVEL IMAGE BUTTONS (under the page video)
----------------------------------------------------- */

.gq-level-images {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin: 16px 0 20px;
}
.gq-level-btn {
  width: 320px;
  max-width: calc(100vw - 40px);
  height: 160px;
  border-radius: 14px;
  border: 0;
  cursor: pointer;
  padding: 0;
  background: #222 center/cover no-repeat;
  box-shadow: 0 0 0 2px var(--gq-ring);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

/* LOCAL images (relative to this CSS file) */
.gq-level-btn--bronze { background-image: url("bronze.jpg"); } /* קל */
.gq-level-btn--silver { background-image: url("silver.jpg"); } /* בינוני */
.gq-level-btn--gold { background-image: url("gold.jpg"); } /* מתקדם */

@media (max-width: 768px) {
  .gq-level-btn { width: 100%; height: 150px; }
}

.level-buttons { text-align: center; margin-bottom: 20px; }
.level-buttons button {
  width: 233px; height: 87px; margin: 0 10px 20px; padding: 0 !important;
  border: 2px solid #000; border-radius: 10px; background: transparent !important;
  cursor: pointer; overflow: hidden; display: inline-flex; align-items: stretch; justify-content: stretch;
}
.level-buttons .gq-btn-img {
  width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 8px; pointer-events: none;
}


/* -----------------------------------------------------
   INTRO / HERO + VIDEO
----------------------------------------------------- */

.gq-intro {
  padding: 18px 16px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Intro card container (same look as quiz card) */
.gq-introcard {
  width: min(700px, 86vw);
  margin: 16px auto !important;             /* unified spacing below header */
  background: #8a0000;
  color: #fff;
  border-radius: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35),
    inset 0 0 0 2px rgba(255, 255, 255, 0.06);
  padding: 20px 22px 26px;
}
.gq-introcard__body {
  background: #8a0000;
  border-radius: 20px;
  padding: 24px 22px 28px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.05);
}

/* HERO banner above the video */
.gq-intro-bg { padding: 18px; }
.gq-hero {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  min-height: 240px;
  margin-bottom: 16px;
}
.gq-hero__content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center !important;
  direction: rtl; text-align: right;
  padding: 22px; color: #fff;
}
.gq-hero__tag {
  width: 225px; height: 58px !important;
  background: url("Improve.png") center/contain no-repeat;
  margin: 0 0 8px 0;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.3));
}
.gq-hero__title {
  margin: 0 0 4px 0;
  font-size: 30px; text-align: center; font-weight: 500; line-height: 1.25;
}
.gq-hero__subtitle { margin: 0; font-size: 30px; opacity: 0.95; }
.gq-hero__note { opacity: 0.9; font-size: 19px; }

@media (max-width: 640px) {
  .gq-hero { min-height: 200px; }
  .gq-hero__tag { width: 180px; height: 59px; }
  .gq-hero__title, .gq-hero__subtitle { font-size: 14px; }
  .gq-hero__note { font-size: 12px; }
}

.gq-video-wrap {
  position: relative; background: #000; border-radius: 12px; overflow: hidden;
  width: min(720px, 72%); aspect-ratio: 16/9; z-index: 1; margin: 0 auto;
}
.gq-video-wrap iframe, .gq-video-wrap video { width: 100%; height: 100%; display: block; }

.gq-intro-actions {
  display: flex; justify-content: center; width: 100%; margin-top: 22px;
}

/* START button (local image) */
.gq-start {
  width: 120px; height: 90px; border: 0; border-radius: 50%;
  background: transparent center/contain no-repeat url("start.png");
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35),
    inset 0 0 0 3px rgba(255, 255, 255, 0.15);
  cursor: pointer; padding: 0; border: none !important; box-shadow: none !important;
}
.gq-start:hover { filter: brightness(1.06); }


/* -----------------------------------------------------
   QUIZ CARD
----------------------------------------------------- */

.gq-quizbar { display: none !important; }

.gq-quizcard {
  width: min(700px, 86vw);
  margin: 16px auto !important;            /* unified spacing below header */
  background: #8a0000; color: #fff; border-radius: 28px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35), inset 0 0 0 2px rgba(255,255,255,0.06);
  padding: 20px 22px 26px;
}

/* Top row: speaker (left) | Next (center) | mic (right) */
.gq-quizcard__top {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; height: 84px; box-sizing: border-box; margin-bottom: 8px;
}

/* Icon buttons base */
.gq-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; padding: 0; margin: 0;
  border-radius: 12px; line-height: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  cursor: pointer; transition: none; outline: none;
}

/* ✅ Speaker button (supports both class names) */
.gq-iconbtn--speaker,
.gq-iconbtn--speak {
  background: url("speaker.png") center/64% no-repeat !important;
  border: none !important;
  min-width: 60px !important;
}

/* ✅ Mic button */
.gq-iconbtn--mic {
  background: url("Mic.png") center/64% no-repeat !important; /* NOTE: file name Mic.png */
  border: none !important;
  min-width: 60px !important;
}

/* Hide inner span icons; using bg images instead */
.gq-iconbtn .gq-icon { display: none !important; }

/* Next pill — absolutely centered (image replacement supported) */
.gq-quizcard__top .gq-next {
  position: absolute; left: 50%; top: 50% !important; transform: translate(-50%, -50%) !important;
  background: radial-gradient(circle at 30% 30%, #a00000, #8a0000 60%, #5e0000);
  border: none !important; border-radius: 999px; color: #fff; font-weight: 700;
  font-size: 18px; letter-spacing: 0.5px; padding: 10px 34px; min-width: 120px; height: 46px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.4), inset 0 3px 6px rgba(255,255,255,0.15);
  cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gq-quizcard__top .gq-next:hover,
.gq-quizcard__top .gq-next:active {
  transform: translate(-50%, -50%) !important;
  filter: none !important;
  box-shadow: 0 10px 20px rgba(0,0,0,0.45);
}

/* Card body */
.gq-quizcard__body {
  background: #8a0000; border-radius: 20px; padding: 34px 26px 28px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.05);
}

/* Sentence + meta */
.gq-sentence { font-size: 28px; line-height: 1.5; margin: 18px 0 16px; text-align: center; }
.gq-transcript { opacity: 0.9; text-align: center; margin-bottom: 6px; min-height: 22px; }
.gq-feedback { text-align: center; min-height: 24px; margin-top: 6px; }
.gq-feedback--ok { color: #17c671; }
.gq-feedback--bad { color: #ff5a5f; }

/* Progress bar */
.gq-progress {
  width: min(560px, 80%); height: 12px; margin: 22px auto 0;
  background: rgba(255, 255, 255, 0.2); border-radius: 999px; overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.35);
}
.gq-progress__fill { height: 100%; width: 0%; background: #f0e4e4 !important; transition: width 0.25s ease; }

/* RTL support */
html[dir="rtl"] .gq-quizcard__top { direction: rtl; }
html[dir="rtl"] .gq-quizcard__top .gq-next { left: 50%; transform: translate(-50%, -50%); }

/* Close button color for intro overlay close */
button#introClose {
  background: #fff !important;
  color: #000 !important;
}

/* Remove all hover/active effects globally where requested */
#gqStart { transition: none !important; filter: none !important; transform: none !important; box-shadow: none !important; min-width: 120px !important; }
.gq-iconbtn,
.gq-level-btn,
.level-buttons button,
#gqStart {
  transition: none !important;
  filter: none !important;
  box-shadow: none !important;
}
.gq-iconbtn:hover,
.gq-iconbtn:active,
.gq-next:hover,
.gq-next:active,
.gq-level-btn:hover,
.gq-level-btn:active,
.level-buttons button:hover,
.level-buttons button:active,
#gqStart:hover,
#gqStart:active {
  filter: none !important;
  box-shadow: none !important;
  background-color: transparent !important;
}

/* Swap positions inside the top bar */
.gq-quizcard__top { display: flex; justify-content: space-between; align-items: center; }
#startSpeaking { order: 1; }        /* Mic left */
.gq-quizcard__top .gq-next { order: 2; } /* Next center (absolute keeps it centered) */
#playSentence { order: 3; }         /* Speaker right */


/* -----------------------------------------------------
   BACKGROUND MIRROR / GLOW behind the dialog area
----------------------------------------------------- */

.gq-modal__dialog::after {
  content: "";
  position: absolute;
  left: 50%; transform: translateX(-50%);
  top: 8px; bottom: 8px;
  width: min(700px, 86vw);
  border-radius: 36px;
  z-index: 0; pointer-events: none; opacity: 0.35;
  background:
    radial-gradient(100% 140% at 30% 0%, rgba(255,255,255,0.14), transparent 65%),
    linear-gradient(135deg, rgba(0,200,255,0.18), rgba(0,0,0,0) 60%, rgba(255,255,255,0.07));
  filter: blur(14px) saturate(1.03);
}

/* Keep real content above the glow */
.gq-modal__dialog > * { position: relative; z-index: 1; }


/* -----------------------------------------------------
   MOBILE REFINEMENTS
----------------------------------------------------- */

@media (max-width: 768px) {
  .gq-introcard { width: 92vw; padding: 16px; }
  .gq-introcard__body { padding: 18px 14px 22px; }
  .gq-introcard .gq-video-wrap { width: 100%; }
  .gq-start { width: 88px; height: 88px; }

  .gq-video-wrap { width: 100%; }

  .gq-sentence { font-size: 22px; }
  .gq-quizcard { width: 92vw; padding: 16px; }
  .gq-quizcard__top { height: 72px; padding: 0 16px; }
  .gq-iconbtn { width: 52px; height: 52px; }
  .gq-quizcard__body { padding: 22px 16px 18px; }
  .gq-progress { width: 90%; height: 10px; }

  .gq-level-images { gap: 12px; }
  .gq-level-btn { height: 140px; }

  .gq-iconbtn--speaker,
  .gq-iconbtn--speak { width: 60px !important; }
  .gq-iconbtn--mic { min-width: 50px !important; }

  .gq-quizcard__top .gq-next {
    min-width: 90px; height: 34px; font-size: 14px; padding: 6px 20px;
  }
}

/* Titles (remove negative margins entirely) */
h3#introTitle,
h3#quizTitle {
  color: #000 !important;

}

/* Clean any old overlay remnants */
#videoOverlay,
#videoOverlay.hidden { display: none !important; }

/* Replace "Next" pill with an image (optional) */
.gq-quizcard__top .gq-next {
  /* If you want image replacement, uncomment the lines below and adjust sizes
  background: transparent url("nextbtn.png") center/contain no-repeat !important;
  width: 180px; height: 76px; min-width: 0 !important; border: none !important;
  padding: 0 !important; box-shadow: none !important; letter-spacing: 0 !important;
  font-size: 0 !important; color: transparent !important;
  */
}

/* === NEXT BUTTON — USE IMAGE instead of pill === */
.gq-quizcard__top .gq-next {
  background: transparent url("nextbtn.png") center/contain no-repeat !important;
  width: 180px !important;
  height: 76px !important;
  min-width: 0 !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  letter-spacing: 0 !important;
  font-size: 0 !important; /* hide original text */
  color: transparent !important;
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
}

/* === DESKTOP: make the right-side builder logo bigger === */
@media (min-width: 768px) {
  /* Give the header a bit more headroom so the taller logo fits */
  .gq-modal__header {
    min-height: 260px !important; /* adjust if you want more/less */
  }

  /* Target the builder logo robustly:
     - explicit .builder class
     - OR the last logo in the header
  */
  .gq-modal__header .gq-logo.builder,
  .gq-modal__header img.gq-logo:last-of-type,
  .gq-modal__header .gq-logo:last-of-type {
    /* Remove earlier caps, then set our own */
    max-height: none !important;
    max-width: none !important;

    width: auto !important;
    height: auto !important;
    object-fit: contain !important;

    /* Final desired size – tweak these */
    max-height: 200px !important;
    max-width: 320px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }
    /* Move middle headline text upward */
  .gq-title {
    margin-top: -20px !important;   /* adjust -10 to -40 if needed */
  }

  /* Move the red exercise box upward */
  .gq-introcard,
  .gq-quizcard {
    margin-top: -130px !important;   /* adjust higher/lower as needed */
  }
  
    .gq-title {
    margin-top: -60px !important;   /* adjust -10 to -40 if needed */
  }
}


/* Mobile size for "Next" image (if using image) */
@media (max-width: 768px) {
  .gq-quizcard__top .gq-next {
    /* width: 140px; height: 60px;  <- only if using image replacement */
  }
  
    .gq-quizcard__top .gq-next {
    width: 140px !important;
    height: 60px !important;
  }
    .gq-modal__header {
    padding-right: 40px !important; /* increase space on the right */
  }
}