/* =========================================================
   File: /css/vocabulary.css
   Dùng cho: /english/vocabulary/ (listing) + có thể tái dùng
   ========================================================= */

/* ===== Wrapper chính (căn giữa nội dung) ===== */
.vocab-wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 46px 18px 70px;
}

/* (Tuỳ chọn) tạo cảm giác section nhẹ */
.vocab-wrap{
  background: linear-gradient(180deg, rgba(128,0,0,.04), transparent 40%);
  border-radius: 22px;
}

/* ===== Header (Vocabulary + mô tả + form add) ===== */
.vocab-head{
  display: flex;
  align-items: flex-end;
  justify-content: center;     /* căn giữa toàn bộ khối */
  text-align: center;          /* text ở giữa */
  gap: 16px;
  flex-wrap: wrap;

  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  margin-bottom: 18px;
}

/* Bọc phần text để không kéo dài quá */
.vocab-head > div{
  width: 100%;
  max-width: 820px;
}

/* Title */
.vocab-head h1{
  margin: 0;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #090224;
}

/* Subtitle / mô tả */
.vocab-head p{
  margin: 10px 0 0;
  color: #6b6b6b;
  font-size: 15px;
}

/* ===== Alert (lỗi / ok) ===== */
.vocab-alert{
  margin: 14px auto 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
  max-width: 820px;
  text-align: left;
}

.vocab-alert.err{
  background: #ffecec;
  color: #a40000;
  border: 1px solid #ffc1c1;
}

.vocab-alert.ok{
  background: #ecfff1;
  color: #0d6b2e;
  border: 1px solid #b9f5c8;
}

/* ===== Form tạo bài (admin) ===== */
.form-add{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;     /* căn giữa form */
  width: 100%;
  margin-top: 6px;
}

.form-add input{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  min-width: 260px;
  background: #fff;
  outline: none;
}

.form-add input:focus{
  border-color: rgba(128,0,0,.35);
  box-shadow: 0 0 0 4px rgba(128,0,0,.08);
}

/* ===== Grid danh sách bài ===== */
.vocab-grid{
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;

  justify-items: center; /* mỗi card nằm giữa ô */
}

@media (max-width: 980px){
  .vocab-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px){
  .vocab-grid{
    grid-template-columns: 1fr;
  }
}

/* ===== Card bài học ===== */
.vocab-card{
  position: relative;
  width: 100%;
  max-width: 520px;           /* card gọn, không trải dài */
  background: #fff;
  border-radius: 18px;
  padding: 18px 16px;
  border: 1px solid rgba(0,0,0,.07);
  box-shadow: 0 10px 30px rgba(9,2,36,.06);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

/* nền highlight nhẹ góc trên */
.vocab-card::before{
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 220px at -10% -10%, rgba(128,0,0,.10), transparent 60%);
  pointer-events: none;
}

.vocab-card:hover{
  transform: translateY(-2px);
  border-color: rgba(128,0,0,.18);
  box-shadow: 0 14px 40px rgba(9,2,36,.10);
}

.vocab-card h3{
  margin: 0 0 8px;
  font-size: 20px;
  color: #090224;
  letter-spacing: -0.01em;
}

.vocab-card p{
  margin: 0 0 12px;
  color: #666;
  line-height: 1.55;
  font-size: 14.5px;
}

/* meta ngày tạo */
.vocab-meta{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #8a8a8a;
  margin: 0 0 14px;
}

/* ===== Actions ===== */
.vocab-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ===== Buttons ===== */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 10px 14px;
  border-radius: 12px;

  border: 1px solid rgba(128,0,0,.25);
  background: #800;
  color: #fff;

  font-weight: 800;
  text-decoration: none;
  cursor: pointer;

  transition: background .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 10px 20px rgba(128,0,0,.14);
}

.btn:hover{
  background: #6b0000;
  transform: translateY(-1px);
}

.btn:active{
  transform: translateY(0);
}

/* Nút outline */
.btn-outline{
  background: #fff;
  color: #800;
  border-color: rgba(128,0,0,.22);
  box-shadow: none;
}

.btn-outline:hover{
  background: rgba(128,0,0,.06);
  transform: translateY(-1px);
}

/* ===== Empty state (khi chưa có bài) ===== */
.vocab-empty{
  max-width: 820px;
  margin: 18px auto 0;
}

/* Nếu bạn muốn code tag nhìn gọn hơn */
.vocab-wrap code{
  background: rgba(0,0,0,.04);
  padding: 2px 6px;
  border-radius: 6px;
}

/* =========================================================
   (Tuỳ chọn) Nếu dùng lại CSS cho trang bài con:
   - Bảng, saved words, v.v.
   ========================================================= */

/* Bảng cơ bản (nếu bài con có table) */
.vocab-wrap table{
  width: 100%;
  border-collapse: collapse;
}

.vocab-wrap th,
.vocab-wrap td{
  padding: 10px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  text-align: left;
}

/* Popup / saved words (nếu bạn dùng vocab-popup.js) */
#dictionary-popup{
  position: fixed;
  z-index: 9999;
}