/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body */
body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f5faff;
  color: #333;
  line-height: 1.6;
}

/* Header */
header {
  background: linear-gradient(135deg, #0077cc, #00bfff);
  color: white;
  padding: 50px 20px;
  text-align: center;
}
header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}
header p {
  font-size: 1.2rem;
}

/* Navbar */
nav {
  background: white;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 1000;
}
nav a {
  padding: 15px 20px;
  text-decoration: none;
  color: #0077cc;
  font-weight: bold;
  position: relative;
}
nav a::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: #0077cc;
  transition: 0.3s;
  transform: translateX(-50%);
}
nav a:hover::after {
  width: 60%;
}

/* Section */
section {
  max-width: 1100px;
  margin: auto;
  padding: 40px 20px;
}
h2 {
  color: #005fa3;
  margin-bottom: 20px;
}

/* Card */
.card {
  background: white;
  padding: 20px;
  margin: 15px 0;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* Grid layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

/* Buttons */
button, .btn {
  background: #0077cc;
  color: white;
  padding: 12px 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
}
button:hover, .btn:hover {
  background: #005fa3;
}

/* Form */
form {
  display: flex;
  flex-direction: column;
}
form input, form textarea {
  margin-bottom: 15px;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
}
form textarea {
  resize: vertical;
}

/* Quiz */
.quiz-box {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.quiz-option {
  display: block;
  background: #eef7ff;
  margin: 10px 0;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}
.quiz-option:hover {
  background: #cce7ff;
}

/* Footer */
footer {
  background: #0077cc;
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 40px;
}
/* Card hover */
.card {
  background: white;
  padding: 20px;
  margin: 15px 0;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  transition: transform 0.4s, box-shadow 0.3s;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

/* Button animation */
button {
  position: relative;
  overflow: hidden;
}
button::after {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: rgba(255,255,255,0.3);
  transition: left 0.4s;
}
button:hover::after {
  left: 0;
}
/* Header slider */
.header-slider {
  position: relative;
  max-width: 1000px;
  height: 350px;           /* đặt chiều cao cố định (bạn chỉnh tùy ý) */
  margin: 20px auto 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  background: #0077cc;        /* nền để khi ảnh nhỏ hơn không bị trống */
}

.header-slider img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 100%;
  max-height: 100%;
  transform: translate(-50%, -50%);  /* căn giữa ảnh */
  opacity: 0;
  transition: opacity 0.7s ease-in-out;
}

.header-slider img.active {
  opacity: 1;
}
/* 📱 Responsive cho Menu và Slider */
@media (max-width: 768px) {
  /* Menu chuyển thành dạng dọc */
  nav {
    flex-direction: column;
    align-items: center;
  }
  nav a {
    padding: 12px;
    display: block;
    width: 100%;
    text-align: center;
    border-top: 1px solid #eee;
  }

  /* Slideshow thu gọn */
  .header-slider {
    max-width: 100%;
    height: 220px;
  }
}

@media (max-width: 480px) {
  nav a {
    font-size: 14px;  /* chữ nhỏ hơn để vừa màn hình */
    padding: 10px;
  }
  .header-slider {
    height: 180px;   /* slider thấp hơn cho màn nhỏ */
  }
}
/* Form đăng bài */
#formDangBai input[type="text"],
#formDangBai input[type="url"],
#formDangBai input[type="password"],
#formDangBai textarea {
  width: 100%;
  padding: 10px;
  margin: 6px 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
}

#formDangBai button {
  background: #0078d7;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.3s;
}

#formDangBai button:hover {
  background: #005fa3;
}

/* Card bài báo */
#dsBai .card {
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

#dsBai .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#dsBai h3 {
  margin: 0 0 8px;
}

#dsBai a {
  text-decoration: none;
  color: #0078d7;
  font-weight: bold;
}

#dsBai a:hover {
  text-decoration: underline;
}

/* Icon */
.icon-link {
  color: #0078d7;
  margin-right: 5px;
}
.icon-article {
  color: #666;
  margin-right: 5px;
}
/* Danh sách bài */
#dsBai .card {
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

#dsBai .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#dsBai h3 a {
  text-decoration: none;
  color: #0078d7;
  font-weight: bold;
}

#dsBai h3 a:hover {
  text-decoration: underline;
}

/* 🌈 Hiệu ứng nền gradient động cho header */
header {
  background: linear-gradient(135deg, #0077cc, #00bfff);
  background-size: 200% 200%;
  animation: gradientMove 6s ease infinite;
}
@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ✨ Hiệu ứng chữ trong header */
header h1 {
  letter-spacing: 1px;
  text-shadow: 0 3px 6px rgba(0,0,0,0.25);
  animation: fadeInDown 1s ease both;
}
header p {
  opacity: 0;
  animation: fadeInUp 1.2s ease forwards 0.5s;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 🩵 Navbar khi cuộn */
nav.scrolled {
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(6px);
  transition: all 0.4s ease;
}

/* 💫 Card có hiệu ứng nổi bật khi hover */
.card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* 🌟 Hiệu ứng bóng sáng trên nút */
button, .btn {
  position: relative;
  overflow: hidden;
}
button::before, .btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0.4), transparent);
  transform: skewX(-25deg);
  transition: left 0.5s;
}
button:hover::before, .btn:hover::before {
  left: 125%;
}

/* 🌐 RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg, #f6fbff, #ffffff);
  color: #333;
  line-height: 1.6;
  animation: fadeInBody 0.6s ease;
}
@keyframes fadeInBody {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 🌈 HEADER */
header {
  text-align: center;
  padding: 60px 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #0077cc, #00bfff, #66d9ff);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

header::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.15), transparent 60%);
  animation: glowRotate 15s linear infinite;
}
@keyframes glowRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

header h1 {
  font-size: 2.6rem;
  letter-spacing: 1px;
  text-shadow: 0 3px 8px rgba(0,0,0,0.25);
  animation: fadeInDown 1s ease both;
}
header p {
  font-size: 1.2rem;
  opacity: 0;
  animation: fadeInUp 1.2s ease forwards 0.4s;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 🧊 NAVBAR */
nav {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 3px 15px rgba(0, 119, 204, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.4s ease;
}

/* Menu list */
nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  padding: 0;
  margin: 0;
}

nav li {
  margin: 0 15px;
}

/* Link style */
nav a {
  position: relative;
  display: block;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
  text-align: center;
  color: #0077cc;
  overflow: hidden; /* Để tia sáng không tràn ra ngoài chữ */
  text-shadow: 0 0 6px rgba(0, 119, 204, 0.3);
  transition: all 0.4s ease;
}

/* Khi hover toàn menu */
nav:hover a {
  text-shadow: 0 0 12px #00bfff, 0 0 20px #0077cc;
}

/* Khi hover từng mục */
nav a:hover {
  color: #000;
  transform: scale(1.05);
}

/* 🌈 Tia sáng quét ngang qua chữ */
nav a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
}

/* 🔁 Khi hover -> tia sáng chạy ngang */
nav a:hover::before {
  animation: lightsweep 0.9s ease forwards;
}

/* 🌟 Gạch sáng dưới chữ */
nav a::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #00bfff, #0077cc);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width 0.35s ease;
}
nav a:hover::after {
  width: 50%;
}

/* ✨ Keyframes tia sáng quét */
@keyframes lightsweep {
  0% {
    left: -75%;
  }
  50% {
    left: 125%;
  }
  100% {
    left: 125%;
  }
}

/* Hiệu ứng khi cuộn */
nav.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 5px 15px rgba(0,119,204,0.12);
}

/* 📱 Mobile responsive */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    align-items: center;
  }
  nav li {
    margin: 10px 0;
  }
  nav a {
    font-size: 18px;
  }
}


/* 🖼️ SLIDER */
.header-slider {
  position: relative;
  max-width: 1000px;
  height: 350px;
  margin: 25px auto 0;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  background: linear-gradient(135deg, #0077cc, #00bfff);
}
.header-slider img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 100%;
  max-height: 100%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 1s ease, transform 1.3s ease;
}
.header-slider img.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.05);
}

/* 📦 SECTION */
section {
  max-width: 1100px;
  margin: auto;
  padding: 40px 20px;
}
h2 {
  color: #005fa3;
  margin-bottom: 20px;
}

/* 🩵 CARD */
.card {
  position: relative;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: all 0.4s ease;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0.2), transparent 70%);
  transition: left 0.6s ease;
}
.card:hover::before {
  left: 100%;
}
.card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* 🧮 GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

/* 💡 BUTTON */
button, .btn {
  position: relative;
  background: linear-gradient(135deg, #0077cc, #00bfff);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,119,204,0.3);
  transition: all 0.3s ease;
  overflow: hidden;
}
button:hover, .btn:hover {
  box-shadow: 0 6px 18px rgba(0,119,204,0.4);
  transform: translateY(-2px);
}
button::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0.4), transparent 80%);
  transform: skewX(-25deg);
  transition: left 0.5s;
}
button:hover::before {
  left: 120%;
}
button:active {
  transform: scale(0.97);
  box-shadow: 0 0 12px rgba(0,183,255,0.6);
}

/* 📝 FORM */
form {
  display: flex;
  flex-direction: column;
}
form input, form textarea {
  margin-bottom: 15px;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  transition: all 0.3s ease;
}
form input:focus, form textarea:focus {
  border-color: #00aaff;
  box-shadow: 0 0 8px rgba(0,170,255,0.3);
  background: #f8fcff;
  outline: none;
}

/* 🧩 QUIZ */
.quiz-box {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.quiz-option {
  display: block;
  background: #eef7ff;
  margin: 10px 0;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: 0.3s;
}
.quiz-option:hover {
  background: linear-gradient(90deg, #cce7ff, #eaf6ff);
  transform: translateX(3px);
}
.quiz-option::after {
  content: "";
  position: absolute;
  top: 0; left: -80%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}
.quiz-option:hover::after {
  left: 120%;
}

/* 💫 FOOTER */
footer {
  text-align: center;
  color: white;
  padding: 25px;
  background: linear-gradient(120deg, #0077cc, #00bfff, #00c6ff);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
}

/* 🪶 SCROLLBAR */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #e6f4ff;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #00aaff, #0077cc);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #0077cc, #005fa3);
}
