/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body */
body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background: #fafafa;
  color: #333;
}

/* Thanh menu */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-bottom: 2px solid #ccc;
  padding: 10px 20px;
}
.top-nav .logo {
  font-weight: bold;
  font-size: 22px;
  color: #ff0000; /* logo đỏ nổi bật */
}
.top-nav nav a {
  margin: 0 10px;
  text-decoration: none;
  color: #333;
  font-weight: bold;
}
.top-nav nav a:hover {
  color: #ff0000;
}
.top-nav .search {
  cursor: pointer;
  font-size: 20px;
}

/* Banner */
.banner {
  width: 100%;
  height: 200px; /* chỉnh cao/thấp tùy ý */
  position: relative;
  overflow: hidden;
}

.banner img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Giữ tỷ lệ, không méo */
  display: block;
}

/* Slide container */
.slide-container {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Slide */
.slide {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}


/* Nội dung chính với sidebar */
.main-content {
  display: flex;
  max-width: 1200px;
  margin: 30px auto;
  gap: 20px;
  padding: 0 15px;
}

/* Bố cục ảnh chính và ảnh nhỏ */
.content-layout {
  display: flex;
  gap: 20px;
}

/* Ảnh chính */
.big-image {
  flex: 3; /* to hơn */
}
.big-image img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 10px;
}

/* Ảnh nhỏ bên phải */
.small-images {
  flex: 1; /* nhỏ hơn */
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.small-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  overflow: hidden;
  text-align: center;
}
.small-card img {
  width: 100%;
  height: 120px;
  object-fit: cover; /* giữ tỉ lệ ảnh */
}
.small-card p {
  padding: 8px;
  font-size: 14px;
  color: #555;
}


/* Sidebar */
.sidebar {
  flex: 1;
  background: linear-gradient(180deg, #ffe0e0, #fff);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.sidebar h3 {
  margin-bottom: 10px;
  color: #ff0000;
}
.sidebar ul {
  list-style: none;
}
.sidebar ul li {
  margin-bottom: 10px;
}
.sidebar ul li a {
  text-decoration: none;
  color: #333;
}
.sidebar ul li a:hover {
  color: #ff0000;
}

/* Khối bài chính */
.main-article {
  flex: 3;
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.main-article img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 15px;
}
.main-article h2 {
  margin-bottom: 10px;
  color: #222;
}
.main-article p {
  color: #555;
}

/* Cards bên dưới */
/* Khối Dự án - Sản phẩm - Dịch vụ */
.cards {
  display: flex;
  max-width: 1200px;
  margin: 20px auto;
  gap: 20px;
  padding: 0 15px;
}

/* Card chung */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  overflow: hidden;
  text-align: center;
}

.card img {
  width: 100%;
  height: 180px; /* chiều cao cố định cho đồng đều */
  object-fit: cover;
}

.card h3 {
  padding: 10px;
  background: #eee;
}

.card p {
  padding: 10px;
  font-size: 14px;
  color: #555;
}


.card.duan {
  flex: 2;
}
.card.sanpham {
  flex: 2;
}
.card.dichvu {
  flex: 1;
}

.container {
  display: grid;
  grid-template-columns: 1fr 4fr 1fr; /* trái 4/5, phải 1/5 */
  gap: 20px;
  margin: 20px;
}

/* Main content */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.banner img {
  width: 100%;
  border-radius: 10px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* chia 3 cột */
  gap: 15px;
}

.content-grid .item img {
  width: 100%;
  border-radius: 8px;
}

/* Sidebar */
/* Bố cục chung: Sidebar trái 1/5, nội dung phải 4/5 */
.layout {
  display: grid;
  grid-template-columns: 1fr 4fr; /* Sidebar 1/5 - Content 4/5 */
  gap: 20px;
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 15px;
}

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, #ffe0e0, #fff);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.sidebar h3 {
  margin-bottom: 10px;
  color: #ff0000;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar ul li {
  margin-bottom: 10px;
}

.sidebar ul li a {
  text-decoration: none;
  color: #333;
}

.sidebar ul li a:hover {
  color: #ff0000;
}

/* Nội dung chính */
.main-article {
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Layout nội dung trong main-article */
.content-layout {
  display: grid;
  grid-template-columns: 3fr 1fr; /* Ảnh lớn 3/4, ảnh nhỏ 1/4 */
  gap: 20px;
}

.big-image img {
  width: 100%;
  border-radius: 8px;
}

.big-image h2 {
  margin-top: 10px;
  font-size: 1.5rem;
  color: #333;
}

.small-images {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.small-card img {
  width: 100%;
  border-radius: 8px;
}

/* Lịch sự kiện */
.events {
  list-style: disc;
  padding-left: 20px;
  margin-top: 10px;
}

.events li {
  margin-bottom: 8px;
}

#schedule-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#schedule-form input {
  flex: 1;
  min-width: 120px;
  padding: 5px 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

#schedule-form button,
#show-form-btn {
  padding: 5px 15px;
  border: none;
  background: #ff0000;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

#schedule-form button:hover,
#show-form-btn:hover {
  background: #cc0000;
}



/* Footer */
footer {
  text-align: center;
  background: #333;
  color: #fff;
  padding: 1rem;
  margin-top: 20px;
}







/* Nút login trong top-nav */
.login-btn {
  cursor: pointer;
  user-select: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  background: #111;
  color: #fff;
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: 0.2s;
}

.login-btn:hover {
  background: #000;
}

/* Menu panel cho user */
.login-menu {
  position: relative;
}
.login-menu__panel {
  position: absolute;
  right: 0;
  top: 120%;
  min-width: 180px;
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  padding: 8px;
  z-index: 20;
}
.login-menu__item {
  padding: 10px 12px;
  border-radius: 8px;
  color: #333;
  text-decoration: none;
  display: block;
}
.login-menu__item:hover {
  background: #f6f6f6;
}

/* ===================== */
/* Responsive cho Mobile */
/* ===================== */
@media (max-width: 768px) {
  /* Thanh menu: đổi thành dạng cột */
  .top-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .top-nav nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .top-nav nav a {
    font-size: 14px;
  }

  /* Banner nhỏ hơn */
  .banner {
    height: 150px;
  }

  /* Sidebar + Main content xếp dọc */
  .layout {
    grid-template-columns: 1fr;
  }

  /* Content layout: ảnh chính trên, ảnh nhỏ dưới */
  .content-layout {
    grid-template-columns: 1fr;
  }
  .small-images {
    flex-direction: row;
    gap: 10px;
    overflow-x: auto; /* Cuộn ngang nếu nhiều ảnh */
  }
  .small-card img {
    height: 100px;
  }

  /* Cards hiển thị dọc thay vì ngang */
  .cards {
    flex-direction: column;
  }

  /* Grid ảnh trong container: đổi thành 2 cột */
  .content-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Sidebar cuối cùng hiển thị dưới main-content */
  .container {
    grid-template-columns: 1fr;
  }
}

/* Nút hamburger */
.menu-toggle {
  display: none;
  font-size: 26px;
  cursor: pointer;
  user-select: none;
  margin-left: 15px; /* cách login 1 chút */
}

/* Mobile */
@media (max-width: 768px) {
  /* Ẩn menu mặc định */
  .top-nav nav {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #fff;
    border-top: 1px solid #ccc;
    margin-top: 10px;
  }

  .top-nav nav a {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
  }

  .top-nav nav.active {
    display: flex;
  }

  /* Hiện hamburger */
  .menu-toggle {
    display: block;
  }

  /* Giữ top-nav hàng ngang: logo | login | ☰ */
  .top-nav {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  /* Gom login + ☰ về phía phải */
  .login-menu {
    order: 1;
  }
  .menu-toggle {
    order: 2;
  }
}

@media (max-width: 768px) {
  .top-nav nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .top-nav nav.active {
    max-height: 500px; /* đủ lớn để chứa toàn bộ menu */
  }
}


/* ===== Modern Sidebar (override) ===== */
.sidebar{
  position: sticky;           /* bám theo khi cuộn */
  top: 72px;                  /* chỉnh theo chiều cao header của bạn */
  align-self: start;
  background: #fff;
  border: 1px solid #f1f1f1;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}

/* Tiêu đề trong sidebar */
.sidebar h3{
  margin: 0 0 12px 0;
  font-size: 18px;
  color: #ff0000;
  letter-spacing: .2px;
  position: relative;
  padding-bottom: 6px;
}
.sidebar h3::after{
  content:"";
  position:absolute; left:0; bottom:0;
  width: 42px; height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff6a6a, #ff0000);
  box-shadow: 0 1px 6px rgba(255,0,0,.25);
}

/* Danh sách link trong sidebar */
.sidebar ul{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.sidebar ul li{
  width: 100%;
}
.sidebar ul li a{
  display: grid;
  grid-template-columns: 10px 1fr; /* chấm tròn + text */
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #222;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fff;
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.sidebar ul li a::before{
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffb3b3, #ff3b3b);
  box-shadow: 0 0 0 2px #ffe5e5 inset;
}
.sidebar ul li a:hover{
  background: #fff7f7;
  border-color: #ffd6d6;
  box-shadow: 0 6px 16px rgba(255,0,0,.10);
  transform: translateX(2px);
}

/* Box con trong sidebar như "Lịch sự kiện", "SNS" ở cột phải container */
.sidebar .calendar, 
.sidebar .sns{
  background: #fff;
  border: 1px solid #f1f1f1;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
}
.sidebar .calendar h3,
.sidebar .sns h3{
  margin-top: 0;
}
.sidebar .calendar ul,
.sidebar .sns ul{
  margin-top: 8px;
}

/* “Chip” nho nhỏ (nếu bạn thêm sau này) */
.sidebar .chip{
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #ffd6d6;
  background: #fff7f7;
  color: #b30000;
  font-size: 12px;
}

/* Khoảng cách giữa nhiều nhóm trong cùng 1 sidebar */
.sidebar > * + *{
  margin-top: 14px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px){
  .sidebar{ top: 64px; }
}
@media (max-width: 768px){
  .sidebar{
    position: static; /* về bình thường khi mobile xếp cột */
    top: auto;
    border-radius: 14px;
  }
  .sidebar ul{
    gap: 10px;
  }
  .sidebar ul li a{
    padding: 12px;
  }
}


/* ===== Sticky Top Nav ===== */
.top-nav{
  position: sticky;     /* bám đỉnh khi cuộn */
  top: 0;
  z-index: 1000;        /* nổi trên nội dung */
  background: #ffffff;  /* đảm bảo nền đục */
  backdrop-filter: saturate(140%) blur(6px); /* nhẹ nhàng hơn khi cuộn (optional) */
  transition: box-shadow .2s ease;
}

/* Bóng đổ khi đã “dính” (class này sẽ bật bằng JS bên dưới) */
.top-nav.stuck{
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

/* Giữ panel đăng nhập nổi cao hơn nội dung */
.login-menu__panel{ z-index: 1200; }

/* Nếu bạn đang dùng khung canh lề cho header */
.top-nav__inner{
  max-width: 1200px;    /* khớp với layout/Sidebar */
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}
