/* ================= RESET ================= */
*{
  box-sizing:border-box;
  margin:0;
  padding:0;
  font-family:Arial, Helvetica, sans-serif;
}

body{
  background:#f4f6f8;
  color:#222;
}


/* ================= HEADER ================= */
#header{
  position: relative;
  height: 120px;
  overflow: hidden;
  color: #fff;
}

/* nền */
.header-bg{
  position:absolute;
  inset:0;
  background-size: cover;
  background-position: center;
  transition: opacity 1s ease;
  z-index: 1;
}

/* lớp phủ */
.header-content{
  position: relative;
  z-index: 2;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,0.35);
}

/* ===== LEFT AVATAR ===== */
.header-left{
  position:absolute;
  left:16px;
  top:50%;
  transform:translateY(-50%);
  display:flex;
  align-items:center;
  gap:10px;
}

#schoolLogo{
  height:64px;
  border-radius:50%;
  background:#fff;
  padding:4px;
}

#teacherAvatar{
  height:60px;
  width:60px;
  border-radius:50%;
  border:2px solid #fff;
  object-fit:cover;
}

/* ===== AVATAR GÓC TRÁI ===== */
.header-left{
  position:absolute;
  top:60px;
  left:12px;
  display:flex;
  flex-direction:column; /* xếp dọc */
  align-items:center;
  gap:6px;
}

/* logo trường */
#schoolLogo{
  height:56px;
  width:auto;
}

/* avatar giáo viên */
#teacherAvatar{
  height:48px;
  width:48px;
  border-radius:50%;
  border:2px solid #fff;
  object-fit:cover;
}

/* ===== CENTER TITLE ===== */
.header-center{
  text-align:center;
}

.header-center h1{
  font-size:30px;          /* LỚN HƠN */
  margin-bottom:6px;
  letter-spacing:1px;
}

.header-center h3{
  font-size:20px;
  font-weight:normal;
  margin-bottom:8px;
  color:#ffeb3b;           /* CHỦ BIÊN MÀU VÀNG */
  text-shadow:
    0 0 6px rgba(255,235,59,0.8),
    0 0 12px rgba(255,235,59,0.6); /* HÀO QUANG */
}

.header-center marquee{
  font-size:14px;
  color:#fff176;
}


/* ================= MENU ================= */
.menu{
  display:flex;
  align-items:center;
  gap:8px;
 position: relative;   /* ← BẮT BUỘC */
  padding:6px 14px;      /* giảm chiều cao */
  margin:0;              /* QUAN TRỌNG */
  border:none;           /* bỏ viền dưới */
  background:#fff;
}


.menu button{
  padding:6px 14px;
  border:1px solid #cfd8dc;
  background:#fff;

  font-weight:700;        /* chữ đậm */
  color:#1565c0;          /* xanh chuẩn */
  border-radius:6px;

  box-shadow:none;        /* bỏ bóng */
}


.menu button:hover{
  background:#e3f2fd;
  border-color:#1565c0;
}

.menu + *{
  margin-top:0 !important;
}


.menu{
  display:flex;
  align-items:center;
}

.menu-left{
  display:flex;
  gap:8px;
}

.menu-right{
  margin-left:auto; /* DÒNG QUAN TRỌNG */
  display:flex;
  gap:8px;
}

/* ================= MENU TREE ================= */
#menuTree{
  position:absolute;
  top:100%;
  left:16px;
  min-width:260px;
  background:#fff;
  border:1px solid #ccc;
  box-shadow:0 4px 10px rgba(0,0,0,0.15);
  padding:6px;
  z-index:1000;
}

/* node */
.node{
  cursor:pointer;
  user-select:none;
  padding:4px 6px;
  font-weight:bold;
}

.node:hover{
  color:#0066cc;
}

/* children */
.children{
  margin-left:16px;
  padding-left:6px;
  border-left:1px dashed #ccc;
}

/* leaf */
.leaf{
  padding:3px 6px;
  cursor:pointer;
  font-size:14px;
}

.leaf:hover{
  text-decoration:underline;
}

/* ================= MAIN ================= */
#main{
  padding:0px;
}

#previewZone{
  margin-top:0px;
}

/* ================= MAIN BACKGROUND ================= */
#main{
  position: relative;
  margin-top: 100px;     /* bù header */
  min-height: calc(100vh - 100px);
padding-bottom: 60px;   /* tăng bao nhiêu tùy thích */
  height: auto;          /* CỰC KỲ QUAN TRỌNG */
  overflow: visible;
}



#mainBg{
  position: absolute;
  top: 0px;
  left: 0;
  right: 0;
  bottom: 0;

  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}


/* nội dung nằm trên nền */
#mainContent{
   position: relative;
  z-index: 2;
  background: rgba(255,255,255,0.65);
  border-radius: 6px;
}

/* ================= AUTH ================= */
.auth-container{
  position:fixed;
  top:80px;
  left:0;
  right:0;
  z-index:2000;
}

.auth-box{
  background:#fff;
  max-width:360px;
  margin:0 auto;
  padding:12px;
  box-shadow:0 4px 12px rgba(0,0,0,0.25);
}

.auth-box h3{
  margin-bottom:10px;
}

.auth-box input{
  width:100%;
  padding:8px;
  margin:6px 0;
}

.auth-box button{
  padding:6px 10px;
  margin-top:6px;
}

/* ================= BELOW ================= */
#below{
  padding:20px;
}

.row3,.row2{
  display:grid;
  gap:16px;
  margin-bottom:20px;
}

.row3{ grid-template-columns:repeat(3,1fr); }
.row2{ grid-template-columns:repeat(2,1fr); }

.col{
  background:#fff;
  padding:12px;
  border-radius:6px;
  border:1px solid #ddd;
}

.col h3{
  margin-bottom:8px;
  font-size:16px;
}

/* ================= FOOTER ================= */
footer{
  margin-top:30px;
  padding:12px;
  text-align:center;
  background:#222;
  color:#fff;
}

footer a{
  color:#4fc3f7;
  text-decoration:none;
  margin-right:10px;
}

#adminLock{ cursor:pointer; }

/* ================= UTIL ================= */
.hidden{
  display:none !important;
}

/* ================= ITEMS TRANG CHỦ ================= */
#below .item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 6px;
}

#below .item img {
  max-width: 20%; /* 1/5 kích thước */
  height: auto;
  border-radius: 4px;
  object-fit: cover;
}


/* ================= PRESENT MODE (FULLSCREEN GIẢ) ================= */
body.presenting{
  overflow: hidden;
}

body.presenting #header,
body.presenting nav.menu,
body.presenting #below,
body.presenting footer{
  display:none !important;
}

body.presenting #main{
  position: fixed;
  inset: 0;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh !important;
  height: 100vh !important;
  overflow: auto !important;
  background:#000;
  z-index:9999;
}

body.presenting #mainContent{
  background:#fff;
  border-radius:0;
}

/* ================= EXAM MODE ================= */
body.exam-mode #main{
  margin-top: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
}

body.exam-mode header,
body.exam-mode nav.menu,
body.exam-mode #below,
body.exam-mode footer{
  display:none !important;
}

/* ================= TEST ENGLISH MODE ================= */
body.exam-mode #header,
body.exam-mode nav.menu,
body.exam-mode #below,
body.exam-mode footer {
  display: none !important;
}

body.exam-mode #main {
  position: fixed !important;
  inset: 0;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh !important;
  background: #f2f4f7;
  z-index: 9999;
}

body.exam-mode #mainBg {
  display: none !important;
}

body.exam-mode #mainContent {
  background: transparent !important;
  border-radius: 0 !important;
}

/* ================= TEST ENGLISH LOGIN ================= */

.exam-overlay {
  position: fixed;
  inset: 0;
  background: transparent !important;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.exam-login-box{
  width: 360px;
  background: #fff;
  padding: 22px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  animation: popup 0.25s ease;
}

@keyframes popup{
  from{
    transform: scale(0.9);
    opacity: 0;
  }
  to{
    transform: scale(1);
    opacity: 1;
  }
}

.exam-login-box h2{
  text-align: center;
  margin-bottom: 18px;
  color: #1565c0;
  letter-spacing: 1px;
}

.form-row{
  margin-bottom: 12px;
}

.form-row label{
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: #555;
}

.form-row input{
  width: 100%;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid #cfd8dc;
  font-size: 14px;
}

.form-row input:focus{
  outline: none;
  border-color: #1565c0;
}

.btn-row{
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.btn{
  flex: 1;
  padding: 8px 0;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

.btn.primary{
  background: #1565c0;
  color: #fff;
}

.btn.primary:hover{
  background: #0d47a1;
}

.btn.secondary{
  background: #e3f2fd;
  color: #1565c0;
}

.btn.secondary:hover{
  background: #bbdefb;
}

#msg{
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
}


/* ================= COMMON AUTH (REGISTER + CHANGE PASS) ================= */

.auth-box {
  width: 360px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);  /* ✅ CỐ ĐỊNH GIỮA MÀN */
  padding: 0;
  border-radius: 0;
 box-shadow: none;          /* ❌ bỏ bóng */
  animation: fadeIn .3s ease;
z-index: 3000;
}









.auth-card {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
}


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

.auth-box h3 {
  text-align: center;
  margin-bottom: 18px;
  color: #333;
}

/* ================= INPUT ================= */
.auth-box input {
  width: 100%;
  padding: 11px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
  transition: .2s;
}

.auth-box input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102,126,234,.15);
}

/* ================= BUTTON ================= */
.auth-box button {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 6px;
  transition: .2s;
}

.auth-box button#btnOk {
  background: #667eea;
  color: #fff;
}

.auth-box button#btnOk:hover {
  background: #5568d9;
}

.auth-box button#btnCancel {
  background: #f1f1f1;
  color: #333;
}

.auth-box button#btnCancel:hover {
  background: #e2e2e2;
}

/* ================= MESSAGE ================= */
#msg {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: #d9534f;
}

/#msg.green {
/  color: #28a745;
/}


/* ===== CLIP YOUTUBE MODULE ===== */

.clip-zone {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* mỗi clip 1 dòng */
.clip-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

/* video nhỏ ~ 1/2 */
.clip-video {
  width: 200px;
  flex-shrink: 0;
}

.clip-video iframe {
  width: 100%;
  height: 50px;        /* 16:9 */
  border: none;
  border-radius: 6px;
}

/* thông tin bên phải */
.clip-info {
  flex: 1;
}

.clip-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
