/* 1. Tăng độ rộng Container cho màn hình 2K (UXL) */
@media (min-width: 1400px) {
  .container, .container-xxl {
    max-width: 1680px; 
  }
}

/* 2. Cấu hình Palette màu VNPOST & Bootstrap Overrides */
:root {
  /* VNPOST Core colors */
  --vnpost-blue: #0055a5;
  --vnpost-orange: #ff9a00;
  --vnpost-yellow: #ffcc00;
  --vnpost-ink: #0f1724;

  /* Bootstrap 5.3 Overrides */
  --bs-primary: var(--vnpost-blue);
  --bs-primary-rgb: 0, 85, 165;
  --bs-link-color: var(--vnpost-blue);
  --bs-link-hover-color: var(--vnpost-orange);
  
  /* Gán Font Roboto đã tải từ fonts.css */
  --bs-body-font-family: 'Roboto', sans-serif;
}

/* Tối ưu hóa hiển thị bảng lãi suất (Dữ liệu từ .theme) */
.interbank-table-wrapper {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.interbank-table thead {
  background-color: var(--vnpost-blue);
  color: white;
}

/* Hiệu ứng cho các khối License AI/Sản phẩm */
.card-product-ai {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(var(--bs-primary-rgb), 0.1);
}

.card-product-ai:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  border-color: var(--vnpost-orange);
}

/* Fix chiều cao ảnh để card không bị lệch */
.article-teaser .field--name-field-image img {
    width: 100%;
    height: 200px; /* Chiều cao cố định */
    object-fit: cover; /* Cắt ảnh không bị méo */
    transition: transform 0.3s ease;
}

/* Hiệu ứng zoom ảnh khi di chuột */
.article-teaser:hover .field--name-field-image img,
.article-teaser:hover .card-img-top {
    transform: scale(1.05);
}

/* Buộc tất cả ảnh trong teaser (kể cả ảnh thật) phải cùng chiều cao */
.article-teaser img {
    width: 100%;
    height: 200px !important; /* Chiều cao cố định */
    object-fit: cover; /* Cắt ảnh để vừa khung mà không bị méo */
}

/* Bo tròn góc trên cho khớp với card */
.article-teaser .article-image-wrapper img {
    border-top-left-radius: var(--bs-border-radius);
    border-top-right-radius: var(--bs-border-radius);
}

.article-body p { margin-bottom: 1.5rem; }

/* --- TỐI ƯU TRANG TÌM KIẾM (SEARCH PAGE) --- */

/* 1. Form tìm kiếm: Đưa Input và Button về cùng 1 hàng */
.path-search .search-form {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
  border: 1px solid #f0f0f0;
}

.path-search .search-form .form-item {
  margin-bottom: 1rem; /* Tạo khoảng cách giữa Label và Input */
}

/* Style ô nhập liệu (Input) */
.path-search .search-form input[type="search"],
.path-search .search-form input.form-search {
  display: block;
  width: 100%;
  padding: 0.8rem 1.2rem;
  font-size: 1.1rem;
  border: 2px solid #e9ecef;
  border-radius: 50px; /* Bo tròn hoàn toàn */
  transition: all 0.3s ease;
}

.path-search .search-form input.form-search:focus {
  border-color: var(--vnpost-blue);
  box-shadow: 0 0 0 5px rgba(0, 85, 165, 0.1);
  outline: none;
}

/* Style nút bấm (Button) - Quan trọng */
.path-search .search-form .form-actions {
  display: flex;
  justify-content: flex-end; /* Đẩy nút sang phải */
  margin-top: 1rem;
}

.path-search .search-form input[type="submit"] {
  width: auto !important; /* BẮT BUỘC: Chống full-width */
  padding: 0.6rem 2.5rem;
  background-color: var(--vnpost-blue);
  color: #fff;
  font-weight: 600;
  border-radius: 50px;
  border: none;
  box-shadow: 0 4px 6px rgba(0, 85, 165, 0.2);
  transition: transform 0.2s, background 0.2s;
  cursor: pointer;
}

.path-search .search-form input[type="submit"]:hover {
  background-color: var(--vnpost-orange);
  transform: translateY(-2px);
}

/* 2. Style Tabs (Content | Users) đẹp hơn */
.path-search .tabs.primary {
  display: flex;
  gap: 2rem;
  padding-left: 0;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 2rem;
  list-style: none;
}

.path-search .tabs.primary li a {
  text-decoration: none;
  color: #6c757d;
  font-weight: 500;
  padding-bottom: 0.8rem;
  display: block;
  position: relative;
  background: transparent;
  border: none;
}

.path-search .tabs.primary li a.is-active {
  color: var(--vnpost-blue);
  font-weight: bold;
}

.path-search .tabs.primary li a.is-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--vnpost-blue);
}

/* 3. Kết quả tìm kiếm: Xóa số thứ tự 1. 2. */
.path-search .search-results {
  list-style: none; /* Xóa dấu chấm/số */
  padding-left: 0;
}

.search-result {
  margin-bottom: 1.5rem;
  border: 1px solid #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem; /* Tăng khoảng cách trong card */
  transition: all 0.3s ease;
}

.search-result:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.08) !important;
  border-color: rgba(0, 85, 165, 0.1);
}


/* Màn hình lớn: Input và Button nằm ngang */
@media (min-width: 768px) {
  .path-search .search-form .form-wrapper { /* Container bao quanh của Drupal */
    display: flex;
    align-items: flex-end; /* Căn đáy */
    gap: 1rem;
  }
  
  .path-search .search-form .form-item {
    flex-grow: 1; /* Input chiếm hết chỗ */
    margin-bottom: 0;
  }

  .path-search .search-form .form-actions {
    margin-top: 0;
    margin-bottom: 0;
  }
}

/* --- STYLE LẠI KHUNG ADVANCED SEARCH (GỌN & ĐẸP) --- */

/* 1. Khung tổng thể */
.path-search details.search-advanced {
  border: 1px solid #e9ecef;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.path-search details.search-advanced[open] {
  padding-bottom: 1rem;
}

.path-search details.search-advanced summary {
  padding: 1rem 1.5rem;
  background-color: #f8f9fa;
  font-weight: 600;
  color: var(--vnpost-blue);
  cursor: pointer;
  border-bottom: 1px solid #e9ecef;
  outline: none;
}

/* 2. Cấu trúc từng dòng (Keywords, Types, Languages) */
/* Drupal bao quanh mỗi nhóm bằng class .criterion */
.path-search .search-advanced .criterion {
  display: grid;
  grid-template-columns: 180px 1fr; /* Cột trái 180px cố định - Cột phải tự giãn */
  gap: 2rem;
  padding: 1.5rem;
  border-bottom: 1px dashed #eee;
  align-items: start;
}

.path-search .search-advanced .criterion:last-child {
  border-bottom: none;
}

/* 3. Cột Nhãn bên trái (Keywords, Types...) */
/* Drupal thường dùng h4 hoặc label cho tiêu đề nhóm */
.path-search .search-advanced .criterion h4,
.path-search .search-advanced .criterion > label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--vnpost-ink);
  margin: 0;
  padding-top: 0.5rem; /* Căn chỉnh với input đầu tiên bên phải */
  text-transform: capitalize;
}

/* 4. Cột Nội dung bên phải (Các ô input) */
.path-search .search-advanced .criterion .form-group,
.path-search .search-advanced .criterion .form-item {
  margin-bottom: 1rem;
  width: 100%;
}

/* --- TÙY CHỈNH RIÊNG TỪNG PHẦN --- */

/* A. Phần Keywords: Input gọn gàng */
.path-search .search-advanced input.form-control,
.path-search .search-advanced input[type="text"] {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.path-search .search-advanced input[type="text"]:focus {
  border-color: var(--vnpost-blue);
  box-shadow: 0 0 0 3px rgba(0, 85, 165, 0.1);
}

/* Label nhỏ của từng input (Containing any...) */
.path-search .search-advanced .criterion label {
  font-size: 0.85rem;
  color: #6c757d;
  margin-bottom: 0.3rem;
  display: block;
  font-weight: normal;
}

/* B. Phần Checkbox (Types, Languages): Style dạng nút bấm (Chips) */
.path-search .search-advanced .form-checkboxes,
.path-search .search-advanced .form-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* Biến từng checkbox thành thẻ tag */
.path-search .search-advanced .form-type-checkbox,
.path-search .search-advanced .form-type-radio {
  margin: 0 !important; /* Reset margin */
}

.path-search .search-advanced .form-type-checkbox label,
.path-search .search-advanced .form-type-radio label {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  background-color: #f1f3f5;
  border: 1px solid transparent;
  border-radius: 50px;
  font-size: 0.9rem;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0;
}

/* Ẩn checkbox thật (nếu muốn đẹp hơn) hoặc để nguyên */
.path-search .search-advanced input[type="checkbox"],
.path-search .search-advanced input[type="radio"] {
  margin-right: 0.5rem;
  accent-color: var(--vnpost-blue); /* Đổi màu tick mặc định */
}

/* Hiệu ứng khi hover vào checkbox */
.path-search .search-advanced .form-type-checkbox:hover label {
  background-color: #e9ecef;
  color: var(--vnpost-blue);
}

/* 5. Nút bấm Submit bên dưới (nếu có) */
.path-search .search-advanced .action {
  padding: 1rem 1.5rem;
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
  text-align: right;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
  .path-search .search-advanced .criterion {
    grid-template-columns: 1fr; /* Chuyển về 1 cột */
    gap: 0.5rem;
  }
  
  .path-search .search-advanced .criterion h4 {
    border-bottom: 2px solid var(--vnpost-orange);
    display: inline-block;
    margin-bottom: 0.5rem;
  }
}


/* --- STYLE THÔNG BÁO (MESSAGES) --- */

.user-messages .messages {
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background-color: #fff;
  font-size: 0.95rem;
}

/* 1. Lỗi (Error) - Màu đỏ */
.user-messages .messages--error {
  background-color: #fef2f2;
  border-color: #fee2e2;
  color: #991b1b;
}

/* Tô màu riêng cho icon lỗi */
.user-messages .messages--error .message-icon i {
  color: #dc2626; /* Đỏ tươi */
  font-size: 1.2rem;
}

/* 2. Thành công (Status) - Màu xanh */
.user-messages .messages--status {
  background-color: #f0fdf4;
  border-color: #dcfce7;
  color: #166534;
}

.user-messages .messages--status .message-icon i {
  color: #16a34a; /* Xanh lá */
  font-size: 1.2rem;
}

/* 3. Cảnh báo (Warning) - Màu vàng */
.user-messages .messages--warning {
  background-color: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.user-messages .messages--warning .message-icon i {
  color: #d97706; /* Vàng cam */
  font-size: 1.2rem;
}

/* Reset danh sách ul/li trong thông báo nếu có */
.user-messages .messages ul {
  margin-bottom: 0;
}