body {
  font-family: 'tahoma', sans-serif;
  padding:0;
  margin:0;
}

/* ตั้งค่าพื้นหลัง */
.main-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #f5f5f5;
}

/* ระบบเรตติ้งดาว */
.star-rating {
  direction: rtl;
  display: inline-flex;
  gap: 2px;
}
.star-rating input {
  display: none;
}
.star-rating label {
  font-size: 2rem;
  color: #d1d5db;
  cursor: pointer;
  transition: color 0.15s;
}
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
  color: #fbbf24;
}
.rating-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  align-items: flex-start;
  margin-top: 1rem;
  border: 1px solid #e5e7eb;
  padding: 12px;
  border-radius: 8px;
}

.rating-section h2{
  font-size: 1.5rem;
  font-weight: 600;
  color: rgb(121, 12, 32) !important;
}

.rating-section .comment-box {
  width: 100%;
  margin-top: 8px;
  border: 1px solid #e5e7eb;
}

/* ปุ่มตัวเลือกประเภทงาน */
.event-type {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.event-type input {
  display: none;
}
.event-type label {
  padding: 10px 18px;
  border: 1px solid #ddd;
  border-radius: 30px;
  cursor: pointer;
  transition: 0.2s;
}
.event-type input:checked + label {
  background: #790c20;
  color: #fff;
  border-color: #790c20;
}

/* Make header a positioning context so the toggle can sit above the title */
header.text-center.mb-8 {
  position: relative;
}

/* Language toggle button (above survey title) */
#lang-toggle {
  position: absolute;
  z-index: 60;
  background: #ffffffcc;
  border: 1px solid rgba(0,0,0,0.08);
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
  color: #790c20;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

#lang-toggle {
  top: 0;
  left: 50;
}

.event-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-top: 1rem;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Organizer page styles */
  .organizer-page .main-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #f5f5f5;
}
  .organizer-page main > img {
    max-width: 100%;
    margin: 0 auto;
    border-radius: 0 0 18px 18px;
  }

  .organizer-page header {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
  }

  .organizer-page #page-title {
    color: #7a300c;
    font-size: 28px;
    line-height: 1.2;
    text-align: center;
  }

  .organizer-page #lang-toggle {
    position: absolute;
    z-index: 60;
    background: #ffffffcc;
    border: 1px solid rgba(0,0,0,0.08);
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 600;
    color: #790c20;
    cursor: pointer;
    backdrop-filter: blur(4px);
  }

  .organizer-page .organizer-card {
    padding: 20px;
    background: #fff;
    border-radius: 14px;
    border: none;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  }

  .organizer-page .organizer-card h2 {
    color: #0f172a;
    font-size: 18px;
    font-weight: 600;
    border-top: 1px solid #eee;
    padding-top: 18px;
  }

  .organizer-page .organizer-card h2:first-child {
    border-top: none;
    padding-top: 0;
  }

  .organizer-page .org-row {
    color: #334155;
    font-size: 15px;
  }

  .organizer-card textarea {
    width: 100%;
    border: 1px solid #ddd;
  }

  .org-row{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgb(249 250 251 / var(--tw-border-opacity, 1));
  }

  .organizer-page button[type="submit"] {
    display: block;
    background: #790c20 !important;
  }

@media (max-width: 640px) {
  #page-title {
    font-size: 18px !important;
    padding: 0 10px;
  }
  #page-subtitle {
    font-size: 14px !important;
  }
  .max-w-3xl {
    width: 100%;
    max-width: 100%;
  }

  main {
    border-radius: 0 !important;
  }

  main img {
    height: 140px !important;
  }

  main > div {
    padding: 10px !important;
  }


  #lang-toggle {
    display: block !important;
    position: absolute;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 999px;
    border: none;
  }

  h1[data-template-id="survey-title"] {
    font-size: 20px !important;
    line-height: 1.25 !important;
  }

  .event-info {
    flex-direction: row;
    margin-top: 10px;
    
  }

  #bqid-display,
  #room-display,
  #date-display {
    font-size: 10px;
    line-height: 0.5;
  }

  #survey-form section {
    padding: 10px !important;
  }

  #survey-form.space-y-6 > * + * {
    margin-top: 12px !important;
  }

  .event-type {
    display: grid;
    grid-template-columns: repeat(3, 2fr);
    gap: 8px;
  }

  .event-type label {
    text-align: center;
    padding: 9px 8px;
    font-size: 12px;
  }

  .star-rating {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .star-rating label {
    font-size: 2rem;
  }

  textarea {
    font-size: 16px !important;
  }

  button[type="submit"] {
    font-size: 1rem !important;
    padding: 12px !important;
  }
  #survey-form section {
    padding: 8px !important;
    margin: 0 !important;
  }

  #survey-form.space-y-6 > * + * {
    margin-top: 6px !important;
  }

  section h2 {
    font-size: 15px !important;
  }

  .star-rating {
    margin-bottom: 2px !important;
  }

  .comment-box {
    margin-top: 4px !important;
    padding: 6px !important;
  }

  textarea {
    min-height: 50px;
  }
  

  @media (max-width: 640px) {
    .organizer-page #page-title {
      font-size: 15px !important;
    }

    .organizer-page .org-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      padding: 8px 0;
    }
  
    .organizer-page .org-row span {
      flex: 1;
      font-size: 12px;
      line-height: 1.35;
    }
  
    .organizer-page .org-row .star-rating {
      width: 110px;
      flex-shrink: 0;
      justify-content: flex-end;
    }
  
    .organizer-page .org-row .star-rating label {
      font-size: 18px;
    }
  }
}
/* ไฮไลต์ข้อที่ยังไม่ได้ให้คะแนน */
.missing {
  outline: 2px solid #dc2626 !important;
  outline-offset: 2px;
  border-radius: 8px;
  background: #fef2f2 !important;
}
.org-row.missing { padding: 4px; }

/* fallback กรณีโหลด Tailwind CDN ไม่ได้ — กันฟอร์ม guest/organizer แสดงซ้อนกัน */
.hidden { display: none !important; }
