/* -------------------------------------------------------------
 * STYLE.CSS - THIẾT KẾ GIAO DIỆN "NHÀ THỜ GẦN TÔI" (MVP)
 * Màu sắc chủ đạo: Đỏ ấm (Warm Red), Trắng, Vàng nhạt.
 * Phong cách: Mobile-first, Hiện đại, Thân thiện cho người lớn tuổi.
 * ------------------------------------------------------------- */

/* 1. KHỞI TẠO HỆ THỐNG BIẾN SỐ (CSS VARIABLES) & RESET */
:root {
  /* Tông màu */
  --primary-color: #b71c1c;      /* Đỏ ấm Công giáo trang nghiêm */
  --primary-light: #e53935;     /* Đỏ sáng cho hover/active */
  --primary-dark: #7f0000;      /* Đỏ sậm quý phái */
  --accent-color: #fbc02d;       /* Vàng nhạt của nến và ánh kim */
  --accent-bg: #fffde7;          /* Nền vàng nhạt ấm áp */
  
  --bg-color: #fcfbf9;           /* Nền ứng dụng sáng ấm */
  --card-bg: #ffffff;            /* Nền thẻ trắng tinh khiết */
  --text-main: #212121;          /* Màu chữ chính độ tương phản cao */
  --text-muted: #666666;         /* Màu chữ phụ */
  --border-color: #eeeeee;       /* Đường viền nhẹ */
  
  /* Trạng thái swipe */
  --color-dislike: #e53935;
  --color-like: #43a047;
  
  /* Bóng đổ và bo góc */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.16);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  /* Kích thước */
  --header-height: 110px;
  --nav-height: 65px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent; /* Tắt viền xanh mặc định khi tap trên mobile */
}

body {
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  background-color: #121212; /* Nền tối sang trọng ngoài viền máy desktop */
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

/* 2. CHẾ ĐỘ MÔ PHỎNG ĐIỆN THOẠI TRÊN DESKTOP */
.app-container {
  width: 100%;
  max-width: 450px; /* Chiều rộng chuẩn của điện thoại */
  height: 100vh;
  max-height: 850px; /* Chiều cao tối đa trên desktop */
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

/* Bo góc màn hình trên Desktop để giống thiết bị thật */
@media (min-width: 451px) {
  .app-container {
    border-radius: 30px;
    height: 92vh;
    border: 6px solid #2d2d2d; /* Viền điện thoại giả lập */
  }
}

/* 3. HEADER & BỘ LỌC KHOẢNG CÁCH */
.app-header {
  background-color: var(--card-bg);
  height: var(--header-height);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  z-index: 100;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-icon {
  width: 28px;
  height: 28px;
  color: var(--primary-color);
}

.app-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.5px;
}

.filter-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.filter-options {
  display: flex;
  gap: 6px;
}

.filter-btn {
  background-color: #f1f1f1;
  border: none;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background-color: #e4e4e4;
}

.filter-btn.active {
  background-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(183, 28, 28, 0.3);
}

/* 4. VÙNG HIỂN THỊ NỘI DUNG CHÍNH */
.app-content {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Quản lý ẩn hiện tab */
.tab-view {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.tab-view.active {
  display: flex;
}

/* 5. TAB KHÁM PHÁ (SWIPE CARD STYLE) */
#tab-explore {
  padding: 16px;
  justify-content: space-between;
}

.swipe-container-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
  margin-bottom: 16px;
}

.card-deck {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 480px;
}

/* Khung thẻ nhà thờ */
.church-card {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: grab;
  user-select: none;
  will-change: transform, opacity;
  border: 1px solid rgba(0,0,0,0.03);
}

.church-card:active {
  cursor: grabbing;
}

/* Ảnh nhà thờ */
.card-image-container {
  width: 100%;
  height: 48%;
  position: relative;
  background-color: #eaeaea;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none; /* Tránh cản trở sự kiện kéo chuột/tay */
}

/* Nhãn khoảng cách trên ảnh */
.card-distance-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Nhãn trạng thái Thích / Bỏ qua khi đang vuốt */
.card-stamp {
  position: absolute;
  top: 30px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0;
  transform: rotate(-15deg);
  pointer-events: none;
  transition: opacity 0.1s ease;
}

.card-stamp.stamp-like {
  right: 30px;
  border: 4px solid var(--color-like);
  color: var(--color-like);
  transform: rotate(15deg);
}

.card-stamp.stamp-dislike {
  left: 30px;
  border: 4px solid var(--color-dislike);
  color: var(--color-dislike);
}

/* Phần thông tin nhà thờ */
.card-info {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(to bottom, #ffffff 80%, var(--accent-bg) 100%);
  overflow-y: auto;
}

.card-main-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.3;
  margin-bottom: 6px;
}

.card-address {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.card-address svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Giờ lễ nổi bật */
.card-schedule {
  background-color: rgba(183, 28, 28, 0.04);
  border-left: 3px solid var(--primary-color);
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 10px;
}

.schedule-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-color);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.schedule-detail {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-main);
}

.schedule-row {
  margin-bottom: 2px;
}

.schedule-row:last-child {
  margin-bottom: 0;
}

/* Mô tả ngắn */
.card-description {
  font-size: 12px;
  color: #777777;
  font-style: italic;
  line-height: 1.4;
}

/* Các lớp hiệu ứng vuốt thẻ bay ra */
.church-card.swipe-left-anim {
  transform: translate(-150%, 0) rotate(-30deg) !important;
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease !important;
}

.church-card.swipe-right-anim {
  transform: translate(150%, 0) rotate(30deg) !important;
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease !important;
}

.church-card.reset-anim {
  transform: translate(0, 0) rotate(0deg) !important;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Thẻ trạng thái (Loading / Empty) */
.deck-status-card {
  width: 100%;
  height: 100%;
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 32px;
  border: 1px dashed var(--border-color);
}

.deck-status-card h3 {
  font-size: 20px;
  color: var(--primary-color);
  margin-bottom: 10px;
  margin-top: 16px;
}

.deck-status-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(183, 28, 28, 0.1);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.status-icon {
  color: var(--primary-color);
  background-color: rgba(183, 28, 28, 0.05);
  padding: 16px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 6. NÚT ĐIỀU KHIỂN SWIPE CHÍNH */
.action-buttons-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 8px 0;
  width: 100%;
}

.action-btn {
  border: none;
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-btn:active {
  transform: scale(0.9);
}

/* Nút Dislike (Bỏ qua) & Like (Yêu thích) - Nút tròn to */
.btn-dislike, .btn-like {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

.btn-dislike svg {
  width: 24px;
  height: 24px;
  color: var(--color-dislike);
}

.btn-like svg {
  width: 26px;
  height: 26px;
  color: var(--color-like);
}

.btn-dislike:hover {
  background-color: rgba(229, 57, 53, 0.05);
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.15);
}

.btn-like:hover {
  background-color: rgba(67, 160, 71, 0.05);
  box-shadow: 0 4px 12px rgba(67, 160, 71, 0.15);
}

/* Nút phụ ở giữa (Gọi điện & Chỉ đường) - Nhỏ hơn */
.btn-call, .btn-directions {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--text-muted);
  text-decoration: none;
}

.btn-call svg, .btn-directions svg {
  width: 20px;
  height: 20px;
}

.btn-call:hover {
  color: var(--primary-color);
  background-color: rgba(183, 28, 28, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-directions:hover {
  color: #1e88e5; /* Màu xanh chỉ đường */
  background-color: rgba(30, 136, 229, 0.05);
  box-shadow: 0 4px 12px rgba(30, 136, 229, 0.1);
}

/* 7. TAB BẢN ĐỒ LEAFLET MAP */
#map-container {
  width: 100%;
  height: 100%;
  position: relative;
}

#leaflet-map {
  width: 100%;
  height: 100%;
  z-index: 5;
}

/* Custom Marker cho User */
.user-location-marker {
  background-color: #2196f3;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(33, 150, 243, 0.8);
  width: 16px !important;
  height: 16px !important;
}

.user-location-pulse {
  position: absolute;
  width: 32px;
  height: 32px;
  background-color: rgba(33, 150, 243, 0.3);
  border-radius: 50%;
  margin-top: -11px;
  margin-left: -11px;
  animation: pulse 1.8s infinite ease-out;
  pointer-events: none;
}

@keyframes pulse {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/* Marker cho Nhà Thờ */
.church-map-marker {
  color: var(--primary-color);
  filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.3));
}

/* Popup Bản đồ phong cách sạch sẽ */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-md);
  padding: 4px;
}

.leaflet-popup-content {
  margin: 12px;
  font-family: inherit;
}

.leaflet-popup-content h4 {
  font-size: 14px;
  color: var(--primary-color);
  margin-bottom: 4px;
  font-weight: 700;
}

.leaflet-popup-content p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.leaflet-popup-content .popup-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  background-color: var(--primary-color);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
}

/* Panel thông tin bật lên dưới đáy Bản đồ khi chạm vào Marker */
.map-info-panel {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  z-index: 1000;
  animation: slideUp 0.3s ease-out;
  border-left: 4px solid var(--primary-color);
}

@keyframes slideUp {
  from { transform: translateY(110%); }
  to { transform: translateY(0); }
}

.panel-close-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
  padding-right: 16px;
}

.panel-distance {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-color);
  background-color: rgba(183, 28, 28, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 8px;
}

.panel-buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  border: none;
}

.btn-sm-primary {
  background-color: var(--primary-color);
  color: #ffffff;
}

.btn-sm-primary:hover {
  background-color: var(--primary-light);
}

.btn-sm-secondary {
  background-color: #f1f1f1;
  color: var(--text-main);
}

.btn-sm-secondary:hover {
  background-color: #e4e4e4;
}

/* 8. TAB ĐÃ LƯU */
#tab-favorites {
  padding: 16px;
  overflow-y: auto;
  height: 100%;
}

.favorites-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
}

.favorites-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
}

.favorites-count {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.favorites-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 24px;
}

/* Thẻ nhà thờ trong danh sách yêu thích */
.fav-item {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  position: relative;
  transition: all 0.2s ease;
}

.fav-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.fav-item-image {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background-color: #eee;
}

.fav-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.fav-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.3;
  padding-right: 20px; /* Nhường chỗ cho nút xóa */
}

.fav-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.fav-item-meta span.dist {
  font-weight: 700;
  color: var(--primary-color);
}

.fav-item-schedule {
  font-size: 11px;
  color: var(--text-main);
  background-color: var(--accent-bg);
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  border-left: 2px solid var(--accent-color);
}

.fav-item-actions {
  display: flex;
  gap: 8px;
}

/* Nút xóa khỏi danh sách đã lưu */
.fav-remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: #c62828;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.fav-remove-btn:hover {
  background-color: #ffebee;
}

.fav-remove-btn svg {
  width: 16px;
  height: 16px;
}

/* Trạng thái danh sách trống */
.favorites-empty {
  text-align: center;
  padding: 48px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.heart-broken-icon {
  color: #bdbdbd;
  margin-bottom: 16px;
}

.favorites-empty p {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.favorites-empty p.sub-text {
  font-size: 12px;
  color: #9e9e9e;
  line-height: 1.5;
  margin-bottom: 24px;
  font-weight: 400;
}

/* Nút chung */
.btn {
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(183, 28, 28, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-light);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #f1f1f1;
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: #e4e4e4;
}

.btn-full {
  width: 100%;
}

/* 9. BOTTOM NAVIGATION BAR */
.app-nav {
  height: var(--nav-height);
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
}

.nav-item {
  background: none;
  border: none;
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #9e9e9e;
  cursor: pointer;
  transition: color 0.2s ease;
  gap: 4px;
}

.nav-icon {
  width: 22px;
  height: 22px;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
}

.nav-item.active {
  color: var(--primary-color);
}

/* Badge thông báo số lượng đã lưu */
.badge-wrapper {
  position: relative;
}

.nav-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  background-color: var(--primary-color);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 4px;
  border: 1px solid var(--card-bg);
}

.nav-badge.hidden {
  display: none;
}

/* 10. MODAL CHỌN VỊ TRÍ DEMO */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: flex-end; /* Bật từ dưới lên giống iOS Sheet */
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-content {
  background-color: var(--card-bg);
  width: 100%;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.2);
  animation: slideUpModal 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  max-height: 80%;
  overflow-y: auto;
}

@keyframes slideUpModal {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header h3 {
  font-size: 18px;
  color: var(--primary-dark);
  margin-bottom: 12px;
  font-weight: 700;
}

.modal-body p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.modal-body p.warning-text {
  color: var(--text-main);
  font-weight: 600;
}

.location-demo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.demo-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
}

.demo-loc-btn {
  background-color: rgba(183, 28, 28, 0.03);
  border: 1px solid rgba(183, 28, 28, 0.1);
  border-left: 4px solid var(--primary-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.2s ease;
}

.demo-loc-btn:hover {
  background-color: rgba(183, 28, 28, 0.08);
  border-color: rgba(183, 28, 28, 0.2);
}

.demo-loc-btn span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.demo-loc-btn .btn-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.manual-input-area {
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  margin-top: 8px;
}

.manual-input-area summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 8px;
  user-select: none;
}

.coords-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.input-field input {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 13px;
  outline: none;
}

.input-field input:focus {
  border-color: var(--primary-color);
}

/* NÚT ĐỒNG BỘ TOÀN CỤC TRÊN HEADER */
.sync-global-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sync-global-btn:hover {
  background-color: rgba(183, 28, 28, 0.05);
  transform: rotate(30deg);
}

.sync-global-btn.syncing svg {
  animation: spin 1s linear infinite;
  color: var(--primary-light);
}

/* CÁC BADGE TRẠNG THÁI GIỜ LỄ */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-verified {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.status-needs_verification {
  background-color: #fffde7;
  color: #f57f17;
  border: 1px solid #fff9c4;
}

.status-conflicting {
  background-color: #fff3e0;
  color: #e65100;
  border: 1px solid #ffe0b2;
}

.status-missing {
  background-color: #f5f5f5;
  color: #616161;
  border: 1px solid #e0e0e0;
}

/* CẢNH BÁO TỰ NHẬP CỤC BỘ */
.user-custom-warning {
  background-color: #fffde7;
  border-left: 3px solid #fbc02d;
  color: #f57f17;
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* CÁC NÚT ĐIỀU KHIỂN GIỜ LỄ TRÊN THẺ */
.card-schedule-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  border-top: 1px dashed rgba(183, 28, 28, 0.1);
  padding-top: 6px;
}

.schedule-action-btn {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.schedule-action-btn:hover {
  background-color: rgba(183, 28, 28, 0.05);
}

/* DANH SÁCH NGUỒN TRONG MODAL */
.source-item {
  background-color: #fcfbf9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.source-item:hover {
  border-color: rgba(183, 28, 28, 0.2);
  box-shadow: var(--shadow-sm);
}

.source-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.source-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
}

.source-confidence-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.confidence-high {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.confidence-medium {
  background-color: #fffde7;
  color: #f57f17;
}

.confidence-low {
  background-color: #ffebee;
  color: #c62828;
}

.source-link {
  font-size: 11px;
  color: #1e88e5;
  text-decoration: none;
  word-break: break-all;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.source-link:hover {
  text-decoration: underline;
}

.source-content-box {
  background-color: #f5f5f5;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-main);
  line-height: 1.4;
  white-space: pre-wrap;
  border-left: 2px solid #bdbdbd;
}

.source-meta-info {
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
}

/* Các tiện ích ẩn */
.hidden {
  display: none !important;
}
