/* CSS CHO CÁC TÍNH NĂNG MỚI (TÌM KIẾM, ĐĂNG NHẬP, ĐĂNG KÝ, BADGE NEW) */

/* 1. BADGE [NEW] PHÁT SÁNG */
.badge-new {
  display: inline-block;
  color: #9c0000 !important;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

  margin-right: 5px;
  cursor: pointer;
}

/* 2. DỰNG LẠI THANH TÌM KIẾM VÀ DROPDOWN GỢI Ý */
#searchcontent {
  position: relative;
  /* Giúp định vị dropdown suggestions */
}
#searchcontent2 {
  position: relative;
  /* Giúp định vị dropdown suggestions */
}

.search-wrapper {
  position: relative;
  width: 100%;
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fffef2;
  /* Màu giấy cuộn cổ trang phù hợp với web */
  border: 2px solid #b56100;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  max-height: 350px;
  overflow-y: auto;
  display: none;
  margin-top: 5px;
}

.search-suggestions.show {
  display: block;
}

.suggestion-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px dashed #d99a22;
  cursor: pointer;
  transition: background-color 0.2s;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
  background-color: #ffecd1;
}

.suggestion-thumb {
  width: 45px;
  height: 45px;
  object-fit: cover;
  border: 1px solid #b56100;
  border-radius: 3px;
  margin-right: 10px;
  background: #ccc;
}

.suggestion-info {
  flex: 1;
  min-width: 0;
}

.suggestion-title {
  font-family: Tahoma, Geneva, sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: #7d0000;
  margin: 0 0 3px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-title mark {
  background: #ffe066;
  color: #000;
  font-weight: bold;
  padding: 0 2px;
  border-radius: 2px;
}

.suggestion-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: #666;
}

.suggestion-tag {
  background: #d99a22;
  color: #fff;
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: bold;
}

.suggestion-empty {
  padding: 15px;
  text-align: center;
  color: #777;
  font-style: italic;
  font-size: 12px;
}

/* 3. POPUP ĐĂNG NHẬP CỔ ĐIỂN */
.auth-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.auth-popup-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.auth-popup-container {
  width: 380px;
  max-width: 90%;
  background: #fffef2;
  /* Nền giấy cuộn cổ kính */
  border: 3px solid #b56100;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transform: translateY(-50px);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.auth-popup-overlay.show .auth-popup-container {
  transform: translateY(0);
}

.auth-popup-header {
  padding: 8px 12px 0 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}



.auth-popup-close {
  background: none;
  border: none;
  color: #b56100;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.auth-popup-close:hover {
  color: #573504;
}

.auth-popup-body {
  padding: 20px;
}

.auth-popup-logo-wrapper {
  text-align: center;
  margin-bottom: 15px;
}

.auth-popup-logo {
  max-width: 150px;
  height: auto;
}

/* AUTH FORM & INPUTS */
.auth-form-group {
  margin-bottom: 12px;
}

.auth-form-group label {
  display: block;
  font-size: 11px;
  font-weight: bold;
  color: #573504;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.auth-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #b56100;
  border-radius: 4px;
  background: #ffffff;
  color: #333333;
  font-size: 12px;
  box-sizing: border-box;
}

.auth-input:focus {
  outline: none;
  border-color: #ff970f;
  background: #ffecd1;
}

.auth-checkbox-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 11px;
}

.auth-checkbox-label {
  display: flex;
  align-items: center;
  color: #573504;
  cursor: pointer;
}

.auth-checkbox-label input {
  margin-right: 5px;
}

.auth-link {
  color: #8b0000;
  text-decoration: none;
  font-weight: bold;
}

.auth-link:hover {
  color: #d92020;
  text-decoration: underline;
}

/* NÚT SUBMIT ĐỒ HỌA CHIẾN QUỐC */
.auth-btn-primary {
  width: 100%;
  height: 32px;
  background: linear-gradient(to bottom, #ff970f 0%, #b56100 100%);
  border: 1px solid #573504;
  border-radius: 4px;
  color: #ffffff;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  text-shadow: 1px 1px 0px #573504;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease;
}

.auth-btn-primary:hover {
  background: linear-gradient(to bottom, #ffa72f 0%, #c57110 100%);
  box-shadow: 0 0 5px rgba(255, 151, 15, 0.6);
}

.auth-btn-primary:disabled {
  background: #cccccc;
  border-color: #999999;
  text-shadow: none;
  cursor: not-allowed;
}

.auth-popup-footer {
  text-align: center;
  margin-top: 15px;
  font-size: 11px;
  color: #573504;
}

.auth-status-msg {
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: bold;
  display: none;
}

.auth-status-msg.error {
  display: block;
  background-color: #ffe6e6;
  border: 1px solid #ff9999;
  color: #cc0000;
}

.auth-status-msg.success {
  display: block;
  background-color: #e6ffe6;
  border: 1px solid #99ff99;
  color: #008000;
}

/* HEADER USER PROFILE AREA */
.header-user-area {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffecd1;
  font-family: Tahoma, Geneva, sans-serif;
  font-size: 11px;
  font-weight: bold;
}

.header-user-area a {
  color: #ffffff;
  text-decoration: none;
  background: rgba(139, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid #b56100;
  transition: background-color 0.2s;
}

.header-user-area a:hover {
  background: rgba(217, 32, 32, 0.8);
}

.user-display-name {
  color: #ff970f;
  text-shadow: 1px 1px 0 #000;
}

/* 4. FORM ĐĂNG KÝ TRANG DANGKY.HTML */
.register-form-box {

  padding: 20px;
  font-family: Tahoma, Geneva, sans-serif;
}

.register-form-box h3 {
  font-family: "Arial Black", Impact, Tahoma, sans-serif;
  font-size: 16px;
  color: #7d0000;
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
  border-bottom: 2px solid #b56100;
  padding-bottom: 10px;
}

.register-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 600px) {
  .register-grid {
    grid-template-columns: 1fr;
  }

  .auth-popup-container {
    width: 95%;
  }
}

.register-form-group {
  margin-bottom: 15px;
  width: 100%;
}

.register-form-group.full-width {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .register-form-group.full-width {
    grid-column: span 1;
  }
}

.register-form-group label {
  display: block;
  font-size: 11px;
  font-weight: bold;
  color: #573504;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.register-form-group input,
.register-form-group select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #b56100;
  border-radius: 4px;
  background: #ffffff;
  color: #333;
  font-size: 12px;
  box-sizing: border-box;
}

.register-form-group input:focus,
.register-form-group select:focus {
  outline: none;
}

.input-helper {
  display: none;
  font-size: 9.5px;
  color: #666;
  margin-top: 3px;
  line-height: 1.2;
}

.register-form-group input:focus~.input-helper,
.register-form-group select:focus~.input-helper,
.register-form-box.show-helpers .input-helper {
  display: block;
}

/* CAPTCHA SECTION */
.captcha-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.captcha-canvas {
  background: #f0f0f0;
  border: 1px solid #b56100;
  border-radius: 4px;
  cursor: pointer;
}

.btn-refresh-captcha {
  background: #b56100;
  border: none;
  border-radius: 4px;
  color: #fff;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s;
}

.btn-refresh-captcha:hover {
  background: #ff970f;
}

.validation-error {
  color: #cc0000;
  font-size: 10px;
  margin-top: 3px;
  font-weight: bold;
  display: none;
}

.register-submit-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(to bottom, #ff970f 0%, #b56100 100%);
  border: 1px solid #573504;
  border-radius: 4px;
  color: #fff;
  font-family: Tahoma, Geneva, sans-serif;
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  text-shadow: 1px 1px 0px #573504;
  cursor: pointer;
  transition: all 0.2s;
}

.register-submit-btn:hover {
  background: linear-gradient(to bottom, #ffa72f 0%, #c57110 100%);
  box-shadow: 0 0 8px rgba(255, 151, 15, 0.7);
}

.register-submit-btn:disabled {
  background: #ccc;
  border-color: #999;
  text-shadow: none;
  cursor: not-allowed;
}