/* ============================================
   K-Trust · Lecture Launcher UI
   교수님 로그인 시에만 표시되는 · 강의 시작 플로팅 패널
   
   위치: 오른쪽 하단 · 접근하기 편한 위치
   톤: K-Trust 브랜드 · 딥 네이비 + 골드 · 프리미엄
   ============================================ */

/* Launcher 컨테이너 · 오른쪽 하단 · 호버 시 확장 방식 (교수님 요청) */
#ktll-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  font-family: 'Pretendard', -apple-system, sans-serif;
  animation: ktllSlideIn 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
  /* 기본 · 접힘 · 값 조작 방해 안 함 */
  transform: translateX(calc(100% - 56px));
  transition: transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1);
  opacity: 0.7;
}
/* 호버 시 · 부드럽게 확장 */
#ktll-container:hover {
  transform: translateX(0);
  opacity: 1;
}
/* 처음 진입 · 재진입 유도 시 · 잠시 완전 확장 (5초 후 자동 접힘) */
#ktll-container.ktll-open-initial {
  transform: translateX(0);
  opacity: 1;
}
/* 접힌 상태 표시 · 왼쪽 골드 라벨 (호버 안내) */
#ktll-container::before {
  content: '🎓';
  position: absolute;
  top: 50%;
  left: -22px;
  transform: translateY(-50%);
  font-size: 22px;
  pointer-events: none;
  opacity: 0.8;
  transition: opacity 260ms ease;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
#ktll-container:hover::before {
  opacity: 0;
}

@keyframes ktllSlideIn {
  from {
    opacity: 0;
    transform: translateX(30px) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

/* 메인 · 강의 시작 버튼 */
.ktll-main-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 26px 18px 22px;
  background: linear-gradient(135deg, #1a3a52 0%, #0f2637 100%);
  color: #faf7f0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 320ms cubic-bezier(0.2, 0.7, 0.2, 1);
  text-align: left;
  min-width: 260px;
  box-shadow:
    0 20px 40px -12px rgba(15, 38, 55, 0.55),
    0 4px 8px -4px rgba(15, 38, 55, 0.2),
    inset 0 1px 0 rgba(212, 175, 55, 0.15);
  position: relative;
  overflow: hidden;
}

/* 상단 골드 시그니처 라인 */
.ktll-main-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d4af37 50%, transparent);
}

.ktll-main-btn:hover {
  transform: translateY(-4px);
  box-shadow:
    0 28px 56px -12px rgba(15, 38, 55, 0.7),
    0 8px 16px -8px rgba(15, 38, 55, 0.3),
    inset 0 1px 0 rgba(212, 175, 55, 0.25);
  background: linear-gradient(135deg, #0f2637 0%, #1a3a52 100%);
}

.ktll-main-btn:active {
  transform: translateY(-2px);
}

/* 아이콘 · 재생 삼각형 */
.ktll-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
  color: #0f2637;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow:
    0 4px 12px -2px rgba(212, 175, 55, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ktll-icon svg {
  width: 22px;
  height: 22px;
}

/* 텍스트 · 라벨 + 서브 */
.ktll-text {
  flex: 1;
  min-width: 0;
}

.ktll-label {
  font-family: 'Noto Serif KR', serif;
  font-size: 17px;
  color: #d4af37;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 4px;
}

.ktll-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: rgba(250, 247, 240, 0.65);
  letter-spacing: 0.06em;
  font-weight: 500;
  line-height: 1.3;
}

/* 화살표 */
.ktll-arrow {
  font-size: 22px;
  color: #d4af37;
  font-weight: 300;
  transition: transform 240ms ease;
  flex-shrink: 0;
}

.ktll-main-btn:hover .ktll-arrow {
  transform: translateX(4px);
}

/* 서브 버튼 · 처음부터 */
.ktll-sub-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.9);
  color: #1a3a52;
  border: 1px solid rgba(26, 58, 82, 0.2);
  border-radius: 3px;
  cursor: pointer;
  font-family: 'Pretendard', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: all 220ms ease;
  box-shadow: 0 4px 12px -4px rgba(15, 38, 55, 0.15);
}

.ktll-sub-btn:hover {
  background: #1a3a52;
  color: #d4af37;
  border-color: #1a3a52;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -6px rgba(15, 38, 55, 0.3);
}

.ktll-sub-btn svg {
  width: 14px;
  height: 14px;
}

/* 힌트 · 하단 */
.ktll-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(15, 38, 55, 0.85);
  color: rgba(250, 247, 240, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 500;
  backdrop-filter: blur(6px);
}

.ktll-hint strong {
  color: #d4af37;
  font-weight: 700;
  font-size: 11px;
  padding: 0 2px;
}

.ktll-hint-icon {
  font-size: 12px;
  opacity: 0.7;
}

/* 반응형 · 태블릿 */
@media (max-width: 900px) {
  #ktll-container {
    bottom: 20px;
    right: 20px;
  }
  .ktll-main-btn {
    min-width: 220px;
    padding: 14px 20px 14px 18px;
  }
  .ktll-icon {
    width: 38px;
    height: 38px;
  }
  .ktll-icon svg {
    width: 18px;
    height: 18px;
  }
  .ktll-label {
    font-size: 15px;
  }
  .ktll-sub {
    font-size: 10px;
  }
}

/* 모바일 · 축소 */
@media (max-width: 640px) {
  #ktll-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
    align-items: stretch;
  }
  .ktll-main-btn {
    min-width: 0;
    width: 100%;
  }
  .ktll-sub-btn {
    align-self: flex-end;
  }
  .ktll-hint {
    align-self: center;
    font-size: 9px;
  }
}

/* ═══════════════════════════════════════════════
   ⭐ 강의 모드 무대 배경 · K-Trust 브랜드 톤 (교수님 요청)
   원본 lecture-mode.css의 검정 배경 오버라이드
   ═══════════════════════════════════════════════ */
body.ktl-mode {
  background: linear-gradient(135deg, #0f2637 0%, #1a3a52 100%) !important;
}

#ktl-shell {
  background: 
    radial-gradient(ellipse at 20% 10%, rgba(212, 175, 55, 0.06), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(26, 58, 82, 0.4), transparent 65%),
    linear-gradient(135deg, #0f2637 0%, #1a3a52 100%) !important;
}

/* 강의 무대 · 딥 네이비 배경 · 골드 액센트 */
.ktl-stage {
  background: transparent !important;
}

/* 상단바 · 하단바 · 살짝 반투명 (콘텐츠와 통일) */
.ktl-topbar,
.ktl-bottombar {
  background: linear-gradient(180deg, rgba(15, 38, 55, 0.95) 0%, rgba(15, 38, 55, 0.85) 100%) !important;
  border-color: rgba(212, 175, 55, 0.2) !important;
  backdrop-filter: blur(8px);
}

/* ═══════════════════════════════════════════════
   ⭐ 강의 모드 컨트롤 강화 · 항상 눈에 띄게
   ═══════════════════════════════════════════════ */

/* 하단 네비게이션 · 항상 표시 (자동 숨김 없음) */
.ktl-bottombar {
  opacity: 1 !important;
}

/* 이전·다음 버튼 · 크고 명확하게 */
.ktl-nav {
  min-height: 52px !important;
  min-width: 120px !important;
  padding: 14px 24px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  transition: all 240ms ease !important;
}

.ktl-nav:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 24px -8px rgba(212, 175, 55, 0.4) !important;
}

/* 상단 조작 버튼 · 크고 명확 */
.ktl-btn-icon {
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 10px !important;
}

.ktl-btn-icon svg {
  width: 22px !important;
  height: 22px !important;
}

/* ═══════════════════════════════════════════════
   ⭐ 진입/재진입 안내 팁 · 최초 1회
   ═══════════════════════════════════════════════ */
.ktl-hint {
  background: rgba(15, 38, 55, 0.92) !important;
  color: rgba(250, 247, 240, 0.85) !important;
  border: 1px solid rgba(212, 175, 55, 0.35) !important;
}

.ktl-hint-key {
  background: #d4af37 !important;
  color: #0f2637 !important;
  font-weight: 700 !important;
}

/* ═══════════════════════════════════════════════
   ⭐ 조작 배지 · 시뮬레이터·A/B/C 등 인터랙션 요소 (교수님 요청)
   슬라이드 안 오버레이 · 시연으로 이동 유도
   위치: 요소 위쪽 바깥 · 절대 값을 가리지 않음
   ═══════════════════════════════════════════════ */
.ktl-interact-badge {
  position: absolute;
  top: -18px;
  left: 16px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px 10px 16px;
  background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
  color: #0f2637;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-family: 'Pretendard', sans-serif;
  text-align: left;
  box-shadow:
    0 10px 24px -8px rgba(212, 175, 55, 0.6),
    0 4px 8px -4px rgba(15, 38, 55, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: all 260ms cubic-bezier(0.2, 0.7, 0.2, 1);
  animation: kibPulse 2.4s ease-in-out infinite;
}
@keyframes kibPulse {
  0%, 100% { 
    box-shadow:
      0 12px 28px -8px rgba(212, 175, 55, 0.55),
      0 4px 8px -4px rgba(15, 38, 55, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.35);
  }
  50% { 
    box-shadow:
      0 16px 36px -8px rgba(212, 175, 55, 0.75),
      0 6px 12px -4px rgba(15, 38, 55, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.4),
      0 0 0 4px rgba(212, 175, 55, 0.15);
  }
}
.ktl-interact-badge:hover {
  transform: translateY(-3px) scale(1.02);
  animation: none;
  background: linear-gradient(135deg, #b8860b 0%, #d4af37 100%);
  box-shadow:
    0 20px 40px -8px rgba(212, 175, 55, 0.7),
    0 8px 16px -6px rgba(15, 38, 55, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.ktl-interact-badge:active {
  transform: translateY(-1px) scale(1.01);
}
.kib-icon {
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}
.kib-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.kib-label {
  font-family: 'Noto Serif KR', serif;
  font-size: 14px;
  font-weight: 700;
  color: #0f2637;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.kib-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(15, 38, 55, 0.7);
  letter-spacing: 0.06em;
  font-weight: 600;
  line-height: 1.3;
}
.kib-arrow {
  font-size: 20px;
  color: #0f2637;
  font-weight: 400;
  line-height: 1;
  transition: transform 220ms ease;
}
.ktl-interact-badge:hover .kib-arrow {
  transform: translateX(4px);
}

/* 모바일 · 배지 축소 */
@media (max-width: 640px) {
  .ktl-interact-badge {
    top: -14px;
    left: 12px;
    padding: 8px 14px 8px 12px;
    gap: 10px;
  }
  .kib-icon { font-size: 16px; }
  .kib-label { font-size: 12px; }
  .kib-sub { font-size: 9px; }
  .kib-arrow { font-size: 16px; }
}

/* ═══════════════════════════════════════════════
   ⭐ 하단바 · 실전 시연 버튼 (D 키 or 클릭) · 교수님 요청
   포인터로 어려운 마우스 조작 대신 · 큰 버튼 · 리모컨 지원
   ═══════════════════════════════════════════════ */
.ktl-demo-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 14px;
  background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
  color: #0f2637;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-family: 'Pretendard', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.005em;
  transition: all 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
  box-shadow: 
    0 6px 16px -4px rgba(212, 175, 55, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  margin-left: 18px;
  animation: ktlDemoPulse 2.6s ease-in-out infinite;
}
@keyframes ktlDemoPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 6px 16px -4px rgba(212, 175, 55, 0.55), inset 0 1px 0 rgba(255,255,255,0.35); }
  50% { transform: scale(1.03); box-shadow: 0 8px 20px -4px rgba(212, 175, 55, 0.7), inset 0 1px 0 rgba(255,255,255,0.5), 0 0 0 3px rgba(212, 175, 55, 0.15); }
}
.ktl-demo-btn:hover {
  animation: none;
  transform: translateY(-2px);
  background: linear-gradient(135deg, #b8860b 0%, #d4af37 100%);
}
.ktl-demo-icon {
  font-size: 16px;
  line-height: 1;
}
.ktl-demo-label {
  font-family: 'Noto Serif KR', serif;
  font-size: 14px;
  font-weight: 700;
}
.ktl-demo-key {
  padding: 2px 7px;
  background: rgba(15, 38, 55, 0.9);
  color: #d4af37;
  border-radius: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════════════
   ⭐ 스크롤 힌트 · 슬라이드 하단 "아래로 계속" (교수님 요청)
   ═══════════════════════════════════════════════ */
.ktl-scroll-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 20px;
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.9) 0%, rgba(184, 134, 11, 0.95) 100%);
  color: #0f2637;
  border-radius: 20px;
  box-shadow:
    0 8px 20px -6px rgba(212, 175, 55, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  pointer-events: none;
  opacity: 1;
  transition: opacity 400ms ease, transform 400ms ease;
  animation: kshBob 1.6s ease-in-out infinite;
}
@keyframes kshBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(5px); }
}
.ktl-scroll-hint.is-fading {
  opacity: 0.4;
}
.ktl-scroll-hint.is-gone {
  opacity: 0;
  transform: translateX(-50%) translateY(15px);
}
.ksh-arrow {
  font-size: 22px;
  line-height: 1;
  color: #0f2637;
  font-weight: 700;
  animation: kshArrowBob 1.2s ease-in-out infinite;
}
@keyframes kshArrowBob {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(2px); opacity: 0.8; }
}
.ksh-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #0f2637;
  font-weight: 700;
  text-transform: uppercase;
}

/* 강의 모드 스테이지 스크롤바 · 골드 강조 (기존 override) */
body.ktl-mode #ktl-stage::-webkit-scrollbar,
body.ktl-mode .ktl-slide-inner::-webkit-scrollbar {
  width: 10px !important;
}
body.ktl-mode #ktl-stage::-webkit-scrollbar-track,
body.ktl-mode .ktl-slide-inner::-webkit-scrollbar-track {
  background: rgba(15, 38, 55, 0.15) !important;
}
body.ktl-mode #ktl-stage::-webkit-scrollbar-thumb,
body.ktl-mode .ktl-slide-inner::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d4af37, #b8860b) !important;
  border-radius: 5px !important;
  border: 2px solid rgba(15, 38, 55, 0.1) !important;
}

/* ═══════════════════════════════════════════════
   ⭐ 재진입 시 · 목적지 요소 강조 (교수님 요청)
   시뮬레이터 위치로 스크롤 · 2초간 골드 하이라이트
   ═══════════════════════════════════════════════ */
.ktl-focus-target {
  animation: ktlFocusPulse 2500ms ease-out;
  position: relative;
  z-index: 10;
}
@keyframes ktlFocusPulse {
  0% {
    box-shadow: 
      0 0 0 0 rgba(212, 175, 55, 0.7),
      0 0 0 0 rgba(212, 175, 55, 0.3);
  }
  30% {
    box-shadow: 
      0 0 0 12px rgba(212, 175, 55, 0.2),
      0 0 0 24px rgba(212, 175, 55, 0.1);
  }
  100% {
    box-shadow: 
      0 0 0 0 rgba(212, 175, 55, 0),
      0 0 0 0 rgba(212, 175, 55, 0);
  }
}

/* Launcher 버튼 · 재진입 유도 펄스 */
.ktll-pulse {
  animation: ktllPulseAtt 1.6s ease-in-out infinite;
}
@keyframes ktllPulseAtt {
  0%, 100% {
    box-shadow:
      0 20px 40px -12px rgba(15, 38, 55, 0.55),
      0 4px 8px -4px rgba(15, 38, 55, 0.2),
      inset 0 1px 0 rgba(212, 175, 55, 0.15);
  }
  50% {
    box-shadow:
      0 24px 48px -8px rgba(212, 175, 55, 0.55),
      0 8px 16px -4px rgba(212, 175, 55, 0.3),
      inset 0 1px 0 rgba(212, 175, 55, 0.35),
      0 0 0 6px rgba(212, 175, 55, 0.12);
  }
}
