
* {
  box-sizing: border-box;
}

body:not(.dark-mode) {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(180deg, #f9fbff 0%, #eef3fb 100%);
  margin: 0;
  padding: 0;
  min-height: 100vh; 
  color: #1a1a1a;
  width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Wrapper để center content nhưng không ảnh hưởng navbar/footer */
body > .merge-container {
  margin: 80px auto 20px;
  padding: 25px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 95%;
}

/* --- Container chính --- */
.merge-container {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  min-height: 120px;
  text-align: center;
  transition: transform 0.3s ease;
}


/* --- Tiêu đề & mô tả --- */
h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #111827;
  line-height: 1.3;
}

p {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 25px;
  line-height: 1.5;
}

/* --- Khu vực Upload --- */
.upload-box {
  border: 3px dashed #69a1fc;
  border-radius: 7px;
  background-color: #e6f1fe;
  padding: 50px 100px;
  min-height: 270px;
  max-width: 800px;
  height: 220px;
  margin: 0 auto;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  position: relative;
  width: 100%;
}

.upload-box.drag-over {
  background-color: #e6f0ff;
  border-color: #2563eb;
  transform: scale(1.01);
  box-shadow: 0 12px 30px rgba(37,99,235,0.2);
}

.upload-box.drag-over .drop-text {
  color: #2563eb;
  font-weight: 700;
}

/* --- Nút chọn file --- */
.select-btn {
  background: linear-gradient(45deg, #2563eb, #8c48e5);
  color: #fff;
  font-weight: 700;
  border: none;
  padding: 15px 40px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
  z-index: 10;
}

/* Expand button to cover the whole parent for clickability */
.select-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.drag-text,
.drop-text {
  font-size: 1rem;
  color: #6b7280;
  text-align: center;
  font-weight: 400;
  margin: 0;
}

.drop-text {
  font-weight: 400;
  font-size: 0.95rem;
  color: #9ca3af;
}

/* --- Danh sách file --- */
.file-list {
  width: 100%;
  margin-top: 15px;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f3f4f6;
  border-radius: 8px;
  margin-bottom: 8px;
}

.file-item span {
  color: #374151;
  font-size: 0.9rem;
}

.file-item small {
  color: #6b7280;
  font-size: 0.8rem;
}

.remove-btn {
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  width: 22px;
  height: 22px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.remove-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* --- Upload button --- */
.upload-btn {
  background: linear-gradient(45deg, #2563eb, #3b82f6);
  color: #fff;
  font-weight: 600;
  border: none;
  padding: 12px 28px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 100%;
  max-width: 260px;
}

.upload-btn:hover {
  background: linear-gradient(45deg, #1d4ed8, #2563eb);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(37,99,235,0.3);
}

.hint {
  margin-top: 12px;
  color: #6b7280;
  font-size: 0.85rem;
}

.hint-text {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: -15px;
  margin-bottom: 10px;
  font-style: normal;
  order: -1;
}

/* --- Loading state --- */
.upload-box.loading {
  position: relative;
  pointer-events: none;
}

.upload-box.loading .select-btn,
.upload-box.loading .drop-text,
.upload-box.loading .drag-text,
.upload-box.loading .file-list,
.upload-box.loading .hint-text {
  visibility: hidden;
}

.loading-bar {
  width: 70%;
  height: 4px;
  background-color: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.loading-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  animation: loading 1s infinite ease-in-out;
}

.loading-text {
  position: absolute;
  top: calc(50% + 20px);
  left: 50%;
  transform: translateX(-50%);
  color: #2563eb;
  font-size: 0.95rem;
  font-weight: 500;
}

@keyframes loading {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* --- Nút next --- */
.next-btn {
  background: linear-gradient(45deg, #10b981, #059669);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.3s ease;
  display: none;
}

.next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(5, 150, 105, 0.4);
}

/* --- Thông tin file --- */
.file-info {
  margin-top: 15px;
  text-align: left;
}

.file-info ul {
  list-style: none;
  padding: 0;
}

.file-info li {
  padding: 8px 12px;
  background: #f3f4f6;
  margin-bottom: 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #374151;
}

/* ========== DARK MODE SYNCHRONIZATION ========== */
body.dark-mode .merge-container,
body.dark-mode .upload-container {
  background-color: #1a1a1a !important;
  color: #f8f9fa !important;
}

body.dark-mode .upload-box {
  background-color: #2d2d2d !important;
  /* Sửa màu viền ở đây thành màu xanh sáng hơn */
  /* Mình cũng đổi lại độ dày là 3px cho giống light mode */
  border: 3px dashed #548ae0 !important; 
}

body.dark-mode .upload-box.drag-over {
  background-color: #3a3a3a !important;
  border-color: #007bff !important;
}

body.dark-mode .select-btn {
  background-color: #007bff !important;
  color: white !important;
}

body.dark-mode .hint-text,
body.dark-mode .drop-text {
  color: #adb5bd !important;
}

body.dark-mode .file-list {
  background-color: transparent !important;
}

body.dark-mode .file-item {
  background-color: #2d2d2d !important;
  border: 1px solid #495057 !important;
  color: #f8f9fa !important;
}

body.dark-mode .file-item span {
  color: #f8f9fa !important;
}

body.dark-mode .file-item small {
  color: #adb5bd !important;
}
