/* === สไตล์หลักสำหรับหน้าอัปโหลด === */
body {
  background-color: #0d1117;
  background-image: radial-gradient(
      at 15% 25%,
      hsla(215, 98%, 61%, 0.15) 0px,
      transparent 50%
    ),
    radial-gradient(at 85% 70%, hsla(320, 98%, 72%, 0.1) 0px, transparent 50%);
  color: #c9d1d9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

/* === สไตล์ Container หลัก === */
.upload-container {
  background-color: rgba(22, 27, 34, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #f0f0f0;
  padding: 30px 40px;
  border-radius: 16px;
  border: 1px solid #30363d;
  box-shadow: 0 0px 20px rgb(0, 0, 0);
  max-width: 600px;
  width: 90%;
  margin: 40px auto;
  box-sizing: border-box;
}

.upload-container h1 {
  font-size: 2.2em;
  font-weight: 700;
  text-align: center;
  margin-bottom: 35px;
  color: #f0f6fc;
  text-shadow: 0 0 10px rgba(88, 166, 255, 0.3);
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-size: 1em;
  font-weight: 500;
  color: #8b949e;
}

/* --- ส่วนของ Social Icons และ Input Fields --- */
.social-icons {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.social-icons img {
  width: 40px;
  height: 40px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
}

.social-icons img.active {
  opacity: 1;
  transform: scale(1.1);
}
.social-icons img.active {
  opacity: 1;
  transform: scale(1.1);
  filter: drop-shadow(0 0 5px #00ffc8);
}

.input-group input[type="text"],
.caption-group input {
  width: 100%;
  padding: 12px;
  background-color: #00000028;
  border: 1px solid #444;
  border-radius: 7px;
  color: #f0f0f0;
  font-size: 1em;
  box-sizing: border-box;
}

/* === สไตล์ส่วนเลือกเวลา === */
.time-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.time-options input[type="radio"] {
  display: none;
}
.time-options label {
  flex-grow: 1;
  text-align: center;
  padding: 12px 10px;
  border: 1px solid #30363d;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  background-color: #21262d;
}
.time-options input[type="radio"]:checked + label {
  background-color: #58a6ff;
  border-color: #58a6ff;
  color: #ffffff;
  font-weight: bold;
  box-shadow: 0 0 15px rgba(88, 166, 255, 0.4);
}

/* === สไตล์ส่วน Drag & Drop === */
.drag-drop-area {
  border: 2px dashed #30363d;
  border-radius: 12px;
  padding: 35px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #0d1117;
}
.drag-drop-area:hover,
.drag-drop-area.file-selected {
  border-color: #58a6ff;
  background-color: #21262d;
  transform: scale(1.02);
}
.drag-drop-area p {
  margin: 0;
  font-size: 1em;
}

.upload-status {
  margin-top: 10px;
  font-weight: bold;
}
.submit-button {
  width: 100%;
  padding: 16px;
  margin-top: 30px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(45deg, #f77f00, #fcbf49);
  color: #000;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.submit-button:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(247, 127, 0, 0.4);
}
.submit-button:disabled {
  background: #3a3a3a;
  color: #888;
  cursor: not-allowed;
}

/* === ส่วนปรับปรุงเพื่อการแสดงผลทุกขนาดหน้าจอ (Responsive) === */
@media (max-width: 640px) {
  .upload-container {
    width: 100%; /* ทำให้เต็มความกว้าง */
    margin: 0; /* ไม่มีระยะห่าง */
    padding: 20px;
    border-radius: 0; /* ไม่มีขอบโค้งบนมือถือ */
    min-height: 100vh; /* ความสูงเต็มจอ */
  }

  .upload-container h1 {
    font-size: 1.6em;
  }

  .form-group p,
  .form-group label {
    font-size: 0.95em;
  }

  .drag-drop-area {
    padding: 25px 15px;
  }

  .modal-content {
    margin: 20px auto; /* [ปรับปรุง] ลดระยะห่างด้านบนของ Modal */
  }
}
.summary-box {
  background-color: #0000005d;
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  text-align: center;
  box-shadow: rgb(25, 23, 32) 0 0 17px;
}
.summary-box h3 {
  margin-top: 0;
  color: #fff;
}
.summary-box .price {
  font-size: 24px;
  font-weight: bold;
  color: #00ffc8;
  margin: 10px 0;
}
.qr-code {
  width: 150px;
  height: 150px;
  margin: 20px auto;
}
.qr-code img {
  border-radius: 12px;
  border: 4px solid #fff;
}
.qr-code-desc {
  font-size: 14px;
  color: #ccc;
}

.arrow-icon {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.drag-drop-area.file-selected {
  border-color: #00ffc8;
}
/* เพิ่มในไฟล์ Upload.css */
.preview-image {
  max-width: 100%;
  max-height: 200px; /* กำหนดขนาดสูงสุด */
  margin-top: 15px; /* เว้นระยะห่างจากข้อความด้านบน */
  border-radius: 8px;
  object-fit: contain; /* ทำให้รูปภาพพอดีกับกรอบ */
}
.qr-code img {
  max-width: 100%;
  height: auto;
  display: block;
}

.loader {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
/* === Input + Action button (อยู่ในช่องเดียว) === */
.input-with-action {
  display: flex;
  align-items: center;
  gap: 0; /* ไม่มีช่องว่างระหว่าง input/ปุ่ม */
  background: #0f141a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px; /* ทำให้ดูเป็น “ช่องเดียว” */
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-with-action:focus-within {
  border-color: #2f6bff;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.15);
}

/* ตัว input กลืนไปกับกล่อง */
.input-with-action > input {
  flex: 1;
  min-width: 0; /* ป้องกันล้นบรรทัด */
  background: transparent;
  border: 0;
  color: #e5e7eb;
  padding: 10px 12px;
  outline: none;
  font-size: 14.5px;
}

/* ปุ่มทางขวา ให้ดูเป็นส่วนเดียวกัน */
.input-with-action__btn {
  background: #2f6bff;
  color: #fff;
  border: 0;
  padding: 10px 14px;
  margin-left: 6px;
  border-radius: 10px; /* โค้งนุ่ม */
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.08s ease;
  white-space: nowrap;
}
.input-with-action__btn:hover {
  filter: brightness(1.05);
}
.input-with-action__btn:active {
  transform: translateY(1px);
}

/* จอเล็ก: ปุ่มไม่กินพื้นที่เกิน */
@media (max-width: 420px) {
  .input-with-action__btn {
    padding: 10px 12px;
  }
}

/* สำหรับ dark theme ที่คุณใช้อยู่ */
.hint {
  color: #8b949e;
  font-size: 12px;
  margin-top: 6px;
  display: inline-block;
}
/* ===== Slip mini preview ===== */
.drag-drop-area {
  position: relative;
}

.mini-preview {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.mini-preview img.mini-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
/* ===== Preview (ใช้ทั้ง image/video/silp) ===== */
.preview-image {
  display: block;
  width: 220px;            /* ปรับได้ */
  max-height: 240px;       /* ปรับได้ */
  object-fit: cover;
  border-radius: 12px;
  margin: 8px auto 0;      /* กลางกล่อง */
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
