body {
  font-family: Arial, sans-serif;
  margin: 2rem;
}

.tooltip-demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.tooltip-demo-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  background: #f9fafb;
}

.tooltip-trigger {
  position: relative;
}

.truncate-box {
  width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid #d1d5db;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: white;
}

.icon-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eff6ff;
  color: #2563eb;
  cursor: pointer;
}

.tooltip-bubble {
  position: fixed;
  z-index: 2000;
  max-width: 260px;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: #111827;
  color: white;
  font-size: 0.95rem;
  line-height: 1.4;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.tooltip-bubble::after {
  content: '';
  position: absolute;
  border: 6px solid transparent;
}

.tooltip-bubble[data-placement="top"]::after {
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: #111827;
}

.tooltip-bubble[data-placement="bottom"]::after {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: #111827;
}

.tooltip-bubble[data-placement="right"]::after {
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: #111827;
}

.tooltip-bubble[data-placement="left"]::after {
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: #111827;
}

.tooltip-position-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

section {
  margin-bottom: 2rem;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1rem 0;
}

.link-list a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

.link-list a:hover {
  text-decoration: underline;
}

.about-target {
  margin-top: 0.75rem;
  font-style: italic;
  color: #555;
}

.api-link-status {
  margin-top: 0.5rem;
  font-weight: 600;
  color: #333;
}

.api-link-response {
  background: #f7f7f7;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
}

h2 {
  margin-top: 0;
}

.frame-demo {
  margin: 1rem 0 1.25rem;
}

.frame-demo iframe {
  width: 100%;
  min-height: 220px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: white;
}

.demo-status {
  margin-top: 0.8rem;
  font-weight: 600;
  color: #166534;
}

.demo-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.demo-modal-content {
  background: white;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.accordion {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.accordion-item {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  text-align: left;
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 600;
  margin: 0;
  border-radius: 0;
}

.accordion-content {
  display: none;
  padding: 0.75rem 1rem;
  background: white;
}

.accordion-item.active .accordion-content {
  display: block;
}

button {
  margin: 0.5rem 0;
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}

button:hover {
  background-color: #1d4ed8;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
  overflow-y: auto;
}

.modal.is-open {
  display: flex;
}

.modal-card {
  background: white;
  border-radius: 12px;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.25);
}

.drawer-modal {
  justify-content: flex-end;
  padding: 0;
}

.drawer-card {
  width: min(420px, 100%);
  height: 100%;
  max-height: 100vh;
  border-radius: 0;
}

.media-card {
  width: min(760px, 100%);
}

.loading-card {
  width: min(320px, 100%);
  text-align: center;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-body {
  padding: 1.25rem;
}

.modal-close,
.modal-close-btn {
  background: #e5e7eb;
  color: #111827;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.8rem;
}

.modal-close:hover,
.modal-close-btn:hover {
  background: #d1d5db;
}

.modal.is-open body {
  overflow: hidden;
}

.spinner {
  width: 36px;
  height: 36px;
  margin: 1rem auto;
  border: 4px solid #dbeafe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.child-modal {
  z-index: 1100;
}

table,
th,
td {
  border: 1px solid black;
  border-collapse: collapse;
  padding: 8px;
}

table {
  width: 100%;
  margin-top: 10px;
}

ul {
  margin-top: 10px;
}

.range-slider-container {
  width: 80%;
  max-width: 400px;
  margin: 50px auto;
  text-align: center;
  font-family: Arial, sans-serif;
}

input[type=range] {
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 6px;
  background: #ddd;
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #4CAF50;
  cursor: pointer;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

input[type=range]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #4CAF50;
  cursor: pointer;
}

.progress-container {
  width: 100%;
  height: 30px;
  background-color: #e0e0e0;
  border-radius: 15px;
  margin: 20px 0;
  position: relative;
}

.progress-bar {
  width: 0;
  height: 100%;
  background-color: #4caf50;
  border-radius: 15px;
  position: relative;
  transition: width 0.1s ease-in-out;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
}

.start-btn {
  padding: 10px 20px;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  margin-top: 10px;
}

.start-btn:hover {
  background-color: #45a049;
}

/* Error message styling */
.error {
  color: #c00;
  font-size: 0.9rem;
  margin-left: 8px;
}

/* Practice Form Styles */
.practice-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  font-family: Arial, sans-serif;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  flex-direction: row;
  gap: 1rem;
}

.form-col {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.radio-group label,
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
}

.radio-group input[type="radio"],
.checkbox-group input[type="checkbox"] {
  cursor: pointer;
  width: auto;
}

/* Multi-select Container Styles */
.multi-select-container {
  position: relative;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.5rem;
  background-color: white;
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
}

#subjectsSelected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}

.subject-tag {
  background-color: #007bff;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.subject-tag .remove-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
}

.subject-tag .remove-btn:hover {
  opacity: 0.8;
}

#subjectsInput {
  border: none;
  outline: none;
  flex: 1;
  min-width: 150px;
  padding: 0.5rem 0;
  font-size: 1rem;
  font-family: Arial, sans-serif;
}

.suggestions-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  border: 1px solid #ccc;
  border-top: none;
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
  border-radius: 0 0 4px 4px;
}

.suggestions-list.show {
  display: block;
}

.suggestions-list li {
  padding: 0.75rem;
  cursor: pointer;
}

.suggestions-list li:hover {
  background-color: #f0f0f0;
}

.suggestions-list li.selected {
  background-color: #e3f2fd;
  font-weight: bold;
}

.submit-btn {
  padding: 0.75rem 2rem;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.submit-btn:hover {
  background-color: #0056b3;
}

.submit-btn:active {
  background-color: #004085;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease-in-out;
}

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

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #333;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e9ecef;
  text-align: right;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
}

.result-table tr {
  border-bottom: 1px solid #e9ecef;
}

.result-table td {
  padding: 0.75rem;
  border: 1px solid #dee2e6;
}

.result-table td:first-child {
  background-color: #2d3436;
  color: white;
  font-weight: 600;
  width: 40%;
}

.result-table td:last-child {
  background-color: #2d3436;
  color: white;
}

.close-btn {
  padding: 0.5rem 1.5rem;
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.close-btn:hover {
  background-color: #5a6268;
}

@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
  }
  
  .modal-content {
    width: 95%;
  }
  
  .result-table td {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
}