* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  min-height: 100vh;
  padding: 40px 20px;
  line-height: 1.6;
}
/* Mobile devices */
@media (max-width: 768px) {
  body {
    padding: 0px;
  }
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 3px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Notice Box */
.notice-box {
  background: #000;
  border-left: 6px solid #ff9800;
  padding: 10px 15px;
  margin-bottom: 30px;
  border-radius: 6px;
}

.notice-box h2 {
  color: #b36b00;
  margin-bottom: 15px;
  font-size: 22px;
}

.notice-box ol {
  padding-left: 20px;
}

.notice-box li {
  margin-bottom: 4px;
  color: #fff;
}

/* English text style */
.en-text {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: #555;
  font-style: italic;
}

.header {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: white;
  padding: 40px 50px;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.header-content {
  position: relative;
  z-index: 1;
}

.header h1 {
  font-size: 2.2em;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.header p {
  font-size: 1em;
  color: #c7d2e8;
  font-weight: 400;
}

.form-content {
  padding: 50px;
}

.section {
  margin-bottom: 50px;
  background: #f8f9fc;
  padding: 35px;
  border-radius: 5px;
  border: 1px solid #9c9c9c;
}

.section-title {
  font-size: 1.5em;
  color: rgb(29, 44, 75);
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #667eea;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-grid {
  /* display: grid; */
  /* grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); */
  gap: 25px;
  margin-bottom: 10px;
}

.form-group {
  display: flex;
  flex-direction: row;
}

.form-group label {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 10px;
  font-size: 0.95em;
  display: flex;
  align-items: center;
  gap: 5px;
  width: 30%;
}

.required::after {
  content: "*";
  color: #e53e3e;
  margin-left: 4px;
}

.form-group input,
.form-group select {
  padding: 8px 16px;
  border: 1px solid #aaabac;
  border-radius: 4px;
  font-size: 0.95em;
  transition: all 0.3s ease;
  background: #ffffff;
  color: #121213;
  font-family: inherit;
  width: 100%;
  margin: 2px 20px;
}

/* Mobile devices */
@media (max-width: 768px) {
  .form-group input,
  .form-group select {
    margin: 0px;
  }
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #222222;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  background: #ffffff;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232d3748' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 45px;
}

.table-container {
  overflow-x: auto;
  margin-top: 20px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  background: white;
  width: 100%;
  display: block;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
  width: max-content;
}

thead {
  background: linear-gradient(135deg, #242424 0%, #6a6b6b 100%);
}

.table-container th {
  padding: 14px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85em;
  color: #ffffff;
  background-color: transparent;
  text-transform: uppercase;
  letter-spacing: 1px;
  min-width: 120px;
  width: auto;
  white-space: nowrap;
}

.table-container th:hover {
  background-color: transparent;
}

th.required-header::after {
  content: " *";
  color: #ffeb3b;
  font-weight: 700;
  margin-left: 2px;
}

th:first-child {
  border-top-left-radius: 4px;
}

th:last-child {
  border-top-right-radius: 4px;
}

td {
  padding: 14px 8px;
  border-bottom: 0.5px solid #6b6b6b;
  background: white;
  min-width: 120px;
  max-width: 300px;
  word-wrap: break-word;
}

tbody tr {
  transition: all 0.2s ease;
}

tbody tr:hover {
  background: #f8f9fc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

tbody tr:last-child td:first-child {
  border-bottom-left-radius: 4px;
}

tbody tr:last-child td:last-child {
  border-bottom-right-radius: 4px;
}

td input {
  width: 100%;
  padding: 8px 6px;
  border: 1px solid #78797a;
  border-radius: 6px;
  font-size: 0.9em;
  transition: all 0.2s ease;
  font-family: inherit;
  min-width: 100px;
}

td input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

td input[required] {
  border-left: 3px solid #e53e3e;
  background-color: #fff5f5;
}

td input[required]:focus {
  border-left-color: #e53e3e;
  background-color: #ffffff;
}

td select {
  width: 100%;
  padding: 8px 6px;
  border: 1px solid #78797a;
  border-radius: 6px;
  font-size: 0.9em;
  transition: all 0.2s ease;
  font-family: inherit;
  background: #ffffff;
  color: #121213;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232d3748' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 30px;
  min-width: 100px;
}

td select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

td select[required] {
  border-left: 3px solid #e53e3e;
  background-color: #fff5f5;
}

td select[required]:focus {
  border-left-color: #e53e3e;
  background-color: #ffffff;
}

.btn {
  padding: 10px 28px;
  border: none;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: #2196f3;
  color: white;
}

.btn-primary:hover {
  background: #1976d2;
  opacity: 0.9;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-success {
  background: #4caf50;
  color: white;
}

.btn-success:hover {
  background: #45a049;
  opacity: 0.9;
}

.btn-secondary {
  background: #757575;
  color: white;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: #616161;
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-danger {
  background: #f44336;
  color: white;
  padding: 8px 15px;
  font-size: 0.9em;
}

.btn-danger:hover {
  background: #da190b;
  opacity: 0.9;
}

.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-danger {
  background: #e74c3c;
  color: white;
  padding: 7px 16px;
  font-size: 0.85em;
}

.button-group {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.table-title {
  font-size: 1.2em;
  font-weight: 700;
  color: #444343;
  flex: 1;
  min-width: 200px;
}

.btn-add-row {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-add-row:hover {
  transform: translateY(-2px);
}

.btn-add-row:active {
  transform: translateY(0);
}

.btn-add-row .btn-icon {
  font-size: 1.2em;
  font-weight: 300;
  line-height: 1;
}

.btn-add-row .btn-text {
  font-size: 0.95em;
}

.btn-add-first-row {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
  width: 100%;
  max-width: 300px;
  margin: 20px auto;
}

.btn-add-first-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
  background: linear-gradient(135deg, #45a049 0%, #4caf50 100%);
}

.btn-add-first-row:active {
  transform: translateY(0);
}

.btn-add-first-row::before {
  content: "+";
  font-size: 1.3em;
  font-weight: 300;
  line-height: 1;
  margin-right: 8px;
  display: inline-block;
}

.add-first-row-container {
  display: none;
}

.add-first-row-container p {
  color: #718096;
  font-size: 0.9em;
  margin-top: 10px;
  font-style: italic;
}

.btn-add-first-row::before {
  content: "+";
  font-size: 1.3em;
  font-weight: 300;
  line-height: 1;
  margin-right: 5px;
}

.info-badge {
  display: inline-block;
  background: #edf2f7;
  color: #4a5568;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  margin-top: 15px;
}

.status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00e013;
  margin-right: 8px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Mobile devices */
@media (max-width: 768px) {
  .form-content {
    padding: 10px 5px;
  }

  .form-group {
    flex-direction: column;
  }

  .form-group label {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 0px;
  }
  .section {
    padding: 25px 20px;
  }

  .header {
    padding: 30px 25px;
  }

  .header h1 {
    font-size: 1.6em;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .table-container {
    font-size: 0.85em;
  }

  .button-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* For Chrome, Edge, Safari */
::-webkit-scrollbar {
  width: 6px;
  /* Thin scrollbar */
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f0f0f0;
  /* Track Background */
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #b3b3b3;
  /* Scroll thumb color */
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #8e8e8e;
  /* Darker when hovered */
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #b3b3b3 #f0f0f0;
}

/* Review Modal Styles */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(245, 245, 245, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-container {
  background-color: #ffffff;
  width: 100%;
  max-width: 1500px;
  max-height: 100vh;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.popup-header {
  background-color: #cfcdcd;
  color: #333;
  padding: 20px 30px;
  border-bottom: 2px solid #ccc;
}

.popup-header h1 {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 5px;
}

.popup-header p {
  font-size: 14px;
  color: #666;
}

.popup-content {
  overflow-y: auto;
  padding: 25px 30px;
  flex: 1;
}

.section {
  margin-bottom: 25px;
}

.section-title {
  background-color: #f0f0f0;
  color: #333;
  padding: 10px 15px;
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 10px;
  border-left: 4px solid #bbb;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 15px;
  font-size: 14px;
}

table th {
  background-color: #f9f9f9;
  color: #212121;
  padding: 10px 12px;
  text-align: left;
  font-weight: bold;
  border: 1px solid #ddd;
  font-size: 13px;
}

table td {
  padding: 9px 12px;
  border: 1px solid #ddd;
  color: #333;
}

table tr:nth-child(even) {
  background-color: #f5f5f5;
}

/* table tr:hover {
  background-color: #ebebeb;
} */

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

.review-item {
  display: flex;
  border: 1px solid #ddd;
  background-color: #fafafa;
}

.review-label {
  background-color: #f5f5f5;
  padding: 8px 12px;
  font-weight: bold;
  font-size: 14px;
  width: 45%;
  border-right: 1px solid #ddd;
}

.review-value {
  padding: 8px 12px;
  font-size: 14px;
  width: 55%;
  color: #333;
}

.popup-footer {
  background-color: #f5f5f5;
  padding: 15px 30px;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-print {
  background-color: #fff;
  color: #333;
  border: 2px solid #999;
}

.btn-print:hover {
  background-color: #f0f0f0;
}

.btn-close {
  background-color: #ccc;
  color: #333;
}

.btn-close:hover {
  background-color: #bbb;
}

.no-data {
  font-style: italic;
  color: #999;
  font-size: 12px;
}

@media print {
  body {
    background-color: #fff;
  }

  .popup-overlay {
    position: static;
    background-color: #fff;
  }

  .popup-footer {
    display: none;
  }

  .popup-container {
    max-height: none;
    box-shadow: none;
  }
}

@media (max-width: 768px) {
  .review-grid {
    grid-template-columns: 1fr;
  }

  .popup-header h1 {
    font-size: 18px;
  }

  .popup-header {
    padding: 15px 20px;
  }

  .popup-content {
    padding: 15px 20px;
  }

  .popup-footer {
    padding: 15px 20px;
  }

  table {
    font-size: 11px;
  }

  table th,
  table td {
    padding: 6px 8px;
    white-space: nowrap;
  }

  /* Make tables horizontally scrollable on mobile */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-container table {
    min-width: 600px; /* Ensure minimum width for readability */
  }

  /* Stack review items vertically on very small screens */
  .review-item {
    flex-direction: column;
  }

  .review-label,
  .review-value {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }

  .review-value {
    border-bottom: none;
  }

  /* Improve section spacing on mobile */
  .section {
    margin-bottom: 20px;
  }

  .section-title {
    font-size: 14px;
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  .popup-container {
    width: 98%;
    max-height: 95vh;
  }

  .popup-header h1 {
    font-size: 16px;
  }

  .popup-header p {
    font-size: 12px;
  }

  table {
    font-size: 10px;
  }

  table th,
  table td {
    padding: 4px 6px;
  }

  .review-label,
  .review-value {
    padding: 6px 8px;
    font-size: 13px;
  }

  .section-title {
    font-size: 13px;
    padding: 6px 10px;
  }

  .btn-print,
  .btn-close {
    padding: 8px 16px;
    font-size: 14px;
  }
}

@media (max-width: 320px) {
  .popup-container {
    width: 100%;
    border-radius: 0;
    max-height: 100vh;
  }

  .popup-header {
    padding: 10px 15px;
  }

  .popup-content {
    padding: 10px 15px;
  }

  .popup-footer {
    padding: 10px 15px;
  }

  table {
    font-size: 9px;
  }

  .table-container table {
    min-width: 500px;
  }
}

/* Additional responsive improvements */
@media (min-width: 769px) and (max-width: 1024px) {
  .popup-container {
    max-width: 1000px;
  }

  .review-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) and (max-width: 1440px) {
  .popup-container {
    max-width: 1100px;
  }
}

/* Ensure tables are always readable */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 15px;
}

.table-container table {
  margin-bottom: 0;
}

/* Improve table readability on all devices */
table th {
  position: sticky;
  top: 0;
  background-color: #f9f9f9;
  z-index: 1;
}

/* Better spacing for review content */
.popup-content .section:last-child {
  margin-bottom: 0;
}

/* Ensure modal doesn't overflow on very wide screens */
@media (min-width: 1441px) {
  .popup-container {
    max-width: 1300px;
  }
}
