/* Container giữ nguyên nhưng nền hơi trong suốt để gradient nổi bật */
.container {
  background: rgba(255, 255, 255, 0.05); /* nền trong suốt nhẹ */
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 20px 24px;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Canvas viền trắng nổi trên gradient */
canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 2px solid #ffffff88;
  background: rgba(255,255,255,0.1);
  margin-bottom: 20px;
}

/* Controls vẫn giữ nguyên style nhưng nền trong suốt để nhìn nổi bật trên gradient */
.controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff; /* chữ trắng nổi trên gradient */
}

select, input[type="text"] {
  margin-top: 5px;
  padding: 8px 10px;
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 8px;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.2);
  color: #fff;
  transition: border-color 0.2s ease, background 0.2s ease;

  /* KHẮC PHỤC BỊ DÀI QUÁ */
  max-height: 40px;
  overflow-y: auto;
}

select:focus, input[type="text"]:focus {
  border-color: #fff;
  background: rgba(255,255,255,0.3);
  outline: none;
}

/* chỉnh màu list bên trong */
select option {
  background: #fff;
  color: #000;
}

/* Button gradient loang */
button {
  margin-top: 12px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #d154d1 0%, #4c65f6 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

button:active {
  transform: scale(0.98);
}

/* Checkbox chữ trắng */
input[type="checkbox"] {
  margin-right: 8px;
  transform: scale(1.2);
}

/* Scrollbar giữ nguyên */
select::-webkit-scrollbar {
  width: 6px;
}
select::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}
select::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Responsive giữ nguyên */
@media (max-width: 500px) {
  .container {
    padding: 16px;
  }

  h1 {
    font-size: 1.4rem;
  }

  button {
    font-size: 0.95rem;
  }
}

/* Nav giữ nguyên */
.nav {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
}

.nav a {
  text-decoration: none;
  color: #ffd700;
  font-size: 18px;
  font-weight: 600;
  padding: 10px 20px;
  border: 2px solid #ffd700;
  border-radius: 12px;
  transition: all 0.3s ease;
  background: rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 10px rgba(255, 215, 0, 0.2);
}

.nav a:hover {
  color: #000;
  background: #ffd700;
  box-shadow: 0 6px 15px rgba(255, 215, 0, 0.5);
  transform: translateY(-2px);
}

.nav a.active {
  color: #000;
  background: #ffcc33;
  border-color: #ffcc33;
  box-shadow: 0 6px 15px rgba(255, 204, 51, 0.5);
}
/* ==== Switch layout ==== */
.switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between; /* chữ bên trái, công tắc bên phải */
  width: 100%;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff; /* đổi thành trắng để nổi trên nền gradient */
  margin-top: 10px;
}
/* ==== Switch design ==== */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #0066ff; /* vàng khi bật */
}

input:checked + .slider:before {
  transform: translateX(22px);
}
/* Hiệu ứng đổi màu liên tục */
.rainbow-text {
  font-weight: 700;
  animation: colorchange 3s infinite linear;
}

@keyframes colorchange {
  0%   { color: #ea0101; }   /* đỏ */
  25%  { color: #ff9900; }   /* cam */
  50%  { color: #00ccff; }   /* xanh dương nhạt */
  75%  { color: #d154d1; }   /* tím */
  100% { color: #ea0101; }   /* quay lại đỏ */
}

    /* Modal Overlay */
    .modal-overlay {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.7);
      z-index: 9999;
      justify-content: center;
      align-items: center;
    }

    .modal-overlay.active {
      display: flex;
    }

    /* Modal Content */
    .modal-content {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border-radius: 20px;
      padding: 30px;
      max-width: 400px;
      width: 80%;
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
      animation: modalSlideIn 0.4s ease-out;
      position: relative;
    }

    @keyframes modalSlideIn {
      from {
        transform: translateY(-50px);
        opacity: 0;
      }

      to {
        transform: translateY(0);
        opacity: 1;
      }
    }

    .modal-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 20px;
    }

    .modal-header .bell-icon {
      font-size: 24px;
    }

    .modal-header h2 {
      color: #fff;
      margin: 0;
      font-size: 24px;
    }

    .modal-banner {
      text-align: center;
      margin-bottom: 20px;
    }

    .modal-banner img {
      max-width: 100%;
      border-radius: 10px;
      box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    .modal-welcome {
      text-align: center;
      margin-bottom: 15px;
    }

    .modal-welcome .verified {
      display: inline-block;
      margin: 0 5px;
    }

    .modal-welcome h3 {
      color: #ff00ff;
      font-size: 20px;
      margin: 10px 0;
      text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    }

    .modal-info {
      background: rgba(255, 255, 255, 0.1);
      border-radius: 10px;
      padding: 15px;
      margin-bottom: 20px;
    }

    .modal-info p {
      color: #fff;
      margin: 10px 0;
      line-height: 1.6;
    }

    .modal-info .emoji {
      margin-right: 5px;
    }

    .modal-info a {
      color: #ffeb3b;
      text-decoration: none;
      font-weight: bold;
    }

    .modal-info a:hover {
      text-decoration: underline;
    }

    .modal-info .highlight {
      color: #ff6b6b;
      font-weight: bold;
    }

    .modal-buttons {
      display: flex;
      gap: 10px;
      justify-content: center;
    }

    .modal-btn {
      padding: 12px 30px;
      border: none;
      border-radius: 25px;
      font-size: 16px;
      font-weight: bold;
      cursor: pointer;
      transition: all 0.3s ease;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .modal-btn.hide {
      background: #fff;
      color: #667eea;
    }

    .modal-btn.hide:hover {
      background: #f0f0f0;
      transform: translateY(-2px);
    }

    .modal-btn.close {
      background: #ff4757;
      color: #fff;
    }

    .modal-btn.close:hover {
      background: #ff3838;
      transform: translateY(-2px);
    }

    .decorative-stars {
      position: absolute;
      top: 10px;
      right: 10px;
      font-size: 20px;
      animation: twinkle 1.5s infinite;
    }

    @keyframes twinkle {

      0%,
      100% {
        opacity: 1;
      }

      50% {
        opacity: 0.5;
      }
    }

    @media (max-width: 600px) {
      .modal-content {
        padding: 20px;
      }

      .modal-buttons {
        flex-direction: column;
      }

      .modal-btn {
        width: 100%;
        justify-content: center;
      }
    }

    #logoGroup {
      cursor: pointer;
    }

    #bannerImg {
      cursor: pointer;
    }

    /* style đẹp cho input file */
#heroImageUpload {
  width: 100%;                 /* full theo label */
  max-width: 100%;             /* không vượt */
  min-height: 42px;            /* chiều cao cố định giống input */
  padding: 10px 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  box-sizing: border-box;      /* để padding không làm bể width */
}


    /* ẩn icon default ugly của browser – dùng nút custom */
    #heroImageUpload::-webkit-file-upload-button {
      visibility: hidden;
    }

    /* nút custom */
    #heroImageUpload::before {
      content: 'Chọn tệp';
      display: inline-block;
      margin-right: 12px;
      padding: 6px 14px;
      border-radius: 6px;
      background: linear-gradient(135deg, #d154d1 0%, #4c65f6 100%);
      color: #fff;
      font-weight: 600;
      cursor: pointer;
    }

    /* hover effect */
    #heroImageUpload:hover {
      border-color: #fff;
      background: rgba(255, 255, 255, 0.3);
    }


    /* hàng button */
    .tab-headers {
      display: flex;
    }

    /* button tab */
    .tab-btn {
      flex: 1;
      padding: 12px 0;
      font-weight: 600;
      font-size: 0.95rem;
      border: none;
      background: transparent;
      color: #ddd;
      cursor: pointer;
      transition: 0.25s;
    }

    /* đang active */
    .tab-btn.active {
      color: #fff;
      background: linear-gradient(135deg, #d154d1 0%, #4c65f6 100%);
    }

    /* hover */
    .tab-btn:not(.active):hover {
      background: rgba(255, 255, 255, 0.08);
    }

    /* nội dung tab */
    .tab-content {
      display: none;
    }

    .tab-content.active {
      display: block;
    }

    /* clear dấu X file */
    .file-input-wrapper {
      position: relative;
      width: 100%;
    }

    .clear-file {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      cursor: pointer;
      color: #ff4757;
      font-size: 18px;
    }