/* CSS cho Khung giao diện chính (Presentation Shell) */

:root {
  /* Mặc định: Dark Theme */
  --bg-shell: #060d1a;
  --bg-header: rgba(6, 13, 26, 0.9);
  --border-shell: rgba(255, 255, 255, 0.06);
  --text-primary: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.55);
  --text-subtle: rgba(255, 255, 255, 0.25);
  --text-hint: rgba(255, 255, 255, 0.18);
  --accent-color: #3b82f6;
  --accent-light: #818cf8;
  
  --nav-btn-bg: rgba(255, 255, 255, 0.07);
  --nav-btn-border: rgba(255, 255, 255, 0.12);
  --nav-btn-color: #ffffff;
  --bar-bg: rgba(6, 13, 26, 0.85);
  
  --dot-bg: rgba(255, 255, 255, 0.18);
  --dot-active-bg: #3b82f6;
  --dot-intro-bg: rgba(139, 92, 246, 0.4);
  --dot-intro-active-bg: #818cf8;
  
  --iframe-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  
  --control-btn-bg: rgba(255, 255, 255, 0.06);
  --control-btn-border: rgba(255, 255, 255, 0.1);
  --control-btn-color: rgba(255, 255, 255, 0.5);
  --control-btn-hover-color: #ffffff;
}

:root[data-theme="light"] {
  /* Light Theme */
  --bg-shell: #f1f5f9; /* Slate 100 */
  --bg-header: rgba(248, 250, 252, 0.95); /* Slate 50 */
  --border-shell: rgba(15, 23, 42, 0.08); /* Slate 900 with opacity */
  --text-primary: #0f172a; /* Slate 900 */
  --text-muted: rgba(15, 23, 42, 0.65);
  --text-subtle: rgba(15, 23, 42, 0.45);
  --text-hint: rgba(15, 23, 42, 0.3);
  --accent-color: #2563eb;
  --accent-light: #4f46e5;
  
  --nav-btn-bg: rgba(15, 23, 42, 0.05);
  --nav-btn-border: rgba(15, 23, 42, 0.1);
  --nav-btn-color: #0f172a;
  --bar-bg: rgba(248, 250, 252, 0.9);
  
  --dot-bg: rgba(15, 23, 42, 0.15);
  --dot-active-bg: #2563eb;
  --dot-intro-bg: rgba(79, 70, 229, 0.25);
  --dot-intro-active-bg: #4f46e5;
  
  --iframe-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
  
  --control-btn-bg: rgba(15, 23, 42, 0.05);
  --control-btn-border: rgba(15, 23, 42, 0.1);
  --control-btn-color: rgba(15, 23, 42, 0.6);
  --control-btn-hover-color: #0f172a;
}

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

body {
  background: var(--bg-shell);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  user-select: none;
  transition: background 0.3s ease;
}

/* ── Header watermark ── */
#wm-header {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 34px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-shell);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
  transition: background 0.3s ease, border-color 0.3s ease;
}

#wm-header .wm-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

#wm-header .wm-dot {
  width: 6px; 
  height: 6px;
  border-radius: 50%;
  background: var(--accent-color);
  opacity: .7;
  transition: background 0.3s ease;
}

#wm-header .wm-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .04em;
  transition: color 0.3s ease;
}

#wm-header .wm-sep {
  color: var(--text-subtle);
  font-size: 11px;
  margin: 0 4px;
  transition: color 0.3s ease;
}

#wm-header .wm-tag {
  font-size: 11px;
  color: var(--accent-color);
  letter-spacing: .05em;
  font-weight: 600;
  transition: color 0.3s ease;
}

#wm-header .wm-right {
  font-size: 11px;
  color: var(--text-subtle);
  letter-spacing: .04em;
  transition: color 0.3s ease;
}

/* ── Slide viewport ── */
#stage {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.slide-wrap {
  position: absolute;
  width: 1280px;
  height: 720px;
  transform-origin: center center;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(.4, 0, .2, 1);
  opacity: 0;
  pointer-events: none;
}

.slide-wrap.active {
  opacity: 1;
  pointer-events: auto;
}

.slide-wrap.exit-left   { transform: translateX(-60px) scale(0.97); opacity: 0; }
.slide-wrap.exit-right  { transform: translateX( 60px) scale(0.97); opacity: 0; }
.slide-wrap.enter-left  { transform: translateX( 60px) scale(0.97); opacity: 0; }
.slide-wrap.enter-right { transform: translateX(-60px) scale(0.97); opacity: 0; }

.slide-wrap iframe {
  width: 1280px;
  height: 720px;
  border: none;
  display: block;
  border-radius: 12px;
  box-shadow: var(--iframe-shadow);
  transition: box-shadow 0.3s ease;
}

/* ── Nút điều hướng Nav ── */
.nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  background: var(--nav-btn-bg);
  border: 1px solid var(--nav-btn-border);
  color: var(--nav-btn-color);
  width: 44px;
  height: 76px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background .2s, border-color .2s, color .2s, opacity .2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-btn:hover { 
  background: rgba(59, 130, 246, 0.25); 
  border-color: rgba(59, 130, 246, 0.45); 
  color: #ffffff;
}

.nav-btn:disabled { 
  opacity: .18; 
  cursor: default; 
}

#btn-prev { left: 12px; }
#btn-next { right: 12px; }

/* ── Bottom bar ── */
#bar {
  flex-shrink: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 80px;
  background: var(--bar-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-shell);
  gap: 12px;
  z-index: 10;
  transition: background 0.3s ease, border-color 0.3s ease;
}

#bar-wm-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

#bar-wm-left .bwl-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .04em;
  transition: color 0.3s ease;
}

#bar-wm-left .bwl-role {
  font-size: 10px;
  color: var(--text-subtle);
  letter-spacing: .03em;
  transition: color 0.3s ease;
}

/* Dots center */
#dots-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#dots {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.dot {
  width: 7px; 
  height: 7px;
  border-radius: 50%;
  background: var(--dot-bg);
  cursor: pointer;
  transition: background .2s, transform .2s, width .2s;
  border: none;
  padding: 0;
}

.dot:hover  { 
  background: var(--text-muted); 
  transform: scale(1.3); 
}

.dot.active { 
  width: 20px; 
  border-radius: 4px; 
  background: var(--dot-active-bg); 
}

.dot.intro  { 
  background: var(--dot-intro-bg); 
}

.dot.intro.active { 
  background: var(--dot-intro-active-bg); 
}

#counter {
  font-size: 11px;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
  transition: color 0.3s ease;
}

#counter strong { 
  color: var(--text-muted); 
  transition: color 0.3s ease;
}

/* Watermark right in bar */
#bar-wm-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

#bar-wm-right .bwr-email {
  font-size: 10px;
  color: var(--text-subtle);
  letter-spacing: .03em;
  transition: color 0.3s ease;
}

#bar-wm-right .bwr-phone {
  font-size: 10px;
  color: var(--text-hint);
  letter-spacing: .03em;
  transition: color 0.3s ease;
}

/* ── Nhóm điều khiển nổi (Floating controls) ── */
.control-group {
  position: fixed;
  bottom: 54px;
  right: 14px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-btn {
  background: var(--control-btn-bg);
  border: 1px solid var(--control-btn-border);
  color: var(--control-btn-color);
  width: 34px; 
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.control-btn:hover { 
  background: rgba(59, 130, 246, 0.25); 
  border-color: rgba(59, 130, 246, 0.45); 
  color: var(--control-btn-hover-color);
  transform: translateY(-2px);
}

/* Hiệu ứng xoay tròn của nút theme khi chuyển đổi */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.control-btn.spinning i {
  animation: spin 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Progress bar */
#progress {
  position: fixed;
  top: 34px; 
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-light));
  border-radius: 0 2px 2px 0;
  transition: width .35s ease;
  z-index: 200;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* Keyboard hint */
#hint {
  position: fixed;
  bottom: 54px;
  left: 14px;
  color: var(--text-hint);
  font-size: 10px;
  letter-spacing: .04em;
  transition: color 0.3s ease;
}
