/* ---------------------------
   Form Styling
--------------------------- */
.ongc-input::placeholder {
  color: #888 !important;
}

label:has(+ input[required])::after,
label:has(+ textarea[required])::after,
label:has(+ select[required])::after,
label:has(input[required])::after {
  content: " *";
  color: red;
  margin-left: 4px;
}

.ongc-form-container {
  max-width: 900px;
  margin: 2rem auto;
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ongc-form-container h2 {
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
  font-weight: 600;
}

.ongc-form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ongc-form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ongc-form-group label {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.ongc-form-group input,
.ongc-form-group textarea,
.ongc-form-group select {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fff;
}

.ongc-checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ongc-form-section {
  margin: 1.5rem 0;
}

.ongc-form-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.ongc-subgrid {
  padding: 1rem;
  font-size: 0.9rem;
  color: #555;
}

.ongc-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
}

.ongc-btn-save {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
}

.ongc-btn-cancel {
  background: #ddd;
  color: #333;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
}

/* Style read-only inputs */
.ongc-input[readonly],
.ongc-input:disabled {
  background-color: #f5f5f5;
  color: #555;
  cursor: not-allowed;
  border-color: #ccc;
}

/* Style for choice description text */
.choice-description {
  font-size: 0.9em;
  color: #6c757d;
  margin-top: 4px;
}

/* Responsive Form */
@media (max-width: 768px) {
  .ongc-form-row {
    flex-direction: column;
  }
}

/* ---------------------------
   Tabs Styling
--------------------------- */
.ongc-tabs {
  display: flex;
  border-bottom: 2px solid #ccc;
  margin-bottom: 1rem;
}

.ongc-tab {
  flex: 1;
  padding: 10px 20px;
  cursor: pointer;
  background: #f4f4f4;
  border: none;
  border-right: 1px solid #ddd;
  font-weight: 600;
  text-align: center;
  transition: background 0.2s ease;
}

.ongc-tab:last-child {
  border-right: none;
}

.ongc-tab:hover {
  background: #e0e0e0;
}

.ongc-tab.active {
  background: #0078d4;
  color: white;
}

/* Tab Content */
.ongc-tab-content {
  display: none;
}

.ongc-tab-content.active {
  display: block;
}


/* ---------------------------
   Loader
--------------------------- */
.ongc-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 1001;
}

/* ---------------------------
   Table & List Styling
--------------------------- */
.ongc-table-container {
  width: 100%;
  min-height: 60vh;
  padding: 1rem;
}

.ongc-toolbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
  width: 50%;
  margin-bottom: 1rem;
  justify-self: center;
}

.ongc-toolbar input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
}

.ongc-toolbar .ongc-btn-create {
  background: var(--bs-primary);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
}

.ongc-table {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ongc-table th,
.ongc-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eee;
  word-wrap: break-word;
}

.ongc-table th {
  background: #f9fafb;
  font-weight: 600;
}

.ongc-table tr:hover {
  background: #f5f5f5;
}

.ongc-btn-edit {
  background: #2563eb;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

/* ---------------------------
   Card Styling (Mobile)
--------------------------- */
.ongc-card-list {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.ongc-card {
  background: #fff;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ongc-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.ongc-card p {
  margin: 0 0 0.5rem;
  color: #555;
  font-size: 0.9rem;
}

/* ---------------------------
   Modal Styling
--------------------------- */
.ongc-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.ongc-modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  width: 50%;
  max-width: 850px;
  max-height: 80%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.3s ease-out;
  position: relative;
  justify-self: center;
}

.ongc-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  cursor: pointer;
}

.ongc-search-input {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
}

.ongc-groups-list {
  flex: 1;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 10px;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 6px;
  background: #fafafa;
}

.hidden {
  display: none;
}

/* ---------------------------
   Group List Styling
--------------------------- */
.ongc-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ongc-group-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 8px;
  background: #fff;
  transition: background 0.2s ease;
}

.ongc-group-list li:hover {
  background: #f9fafb;
}

.ongc-btn-remove {
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.ongc-btn-remove:hover {
  background: #b91c1c;
}

#groupsListWrapper {
  flex: 1;
  /* Take up remaining space */
  overflow-y: auto;
  /* Scrollable area */
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 6px;
}

#licensesListWrapper {
  flex: 1;
  overflow-y: auto;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 6px;
}


.ongc-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
  background: #fff;
  position: sticky;
  /* Pin to bottom inside modal */
  bottom: 0;
}

/* ---------------------------
   Animations
--------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------------------
   Responsive Breakpoints
--------------------------- */
/* Tablet (Users list override: hide cols 3–5 for #ongc-dataTable) */
@media (max-width: 991px) and (min-width: 577px) {

  #groupsTable th:nth-child(3),
  #groupsTable td:nth-child(3) {
    display: none;
  }

  #ongc-dataTable th:nth-child(3),
  #ongc-dataTable th:nth-child(4),
  #ongc-dataTable th:nth-child(5),
  #ongc-dataTable td:nth-child(3),
  #ongc-dataTable td:nth-child(4),
  #ongc-dataTable td:nth-child(5) {
    display: none;
  }
}

/* Mobile (cards only) */
@media (max-width: 576px) {
  .ongc-table {
    display: none;
  }

  .ongc-card-list {
    display: flex;
  }

  #groupModal .ongc-table {
    display: none;
  }

  #groupModal .ongc-card-list {
    display: flex;
  }

  .ongc-modal-content {
    width: 90%;
    height: auto;
    max-height: 90%;
    border-radius: 8px;
  }
}

/* ---------------------------
   Toggle Switch
--------------------------- */
/* Align label and toggle side by side */
.ongc-toggle-group {
  display: flex;
  align-items: center;
  gap: 0.75rem; /* space between label and toggle */
  margin-top: 0.5rem;
}

/* Toggle switch container */
.ongc-toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

/* Hide the checkbox */
.ongc-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Slider background */
.ongc-toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccc;
  border-radius: 24px;
  transition: background-color 0.3s;
}

/* Slider knob */
.ongc-toggle-switch .slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

/* Checked state */
.ongc-toggle-switch input:checked + .slider {
  background-color: #2196F3;
}

.ongc-toggle-switch input:checked + .slider::before {
  transform: translateX(22px);
}

/* ---------------------------
   Header Styling
--------------------------- */
.clientLogo {
    margin: 0 10px;
    height: 32px;
    width: auto;
    position: relative;
    top: 5px;
}

/* ---------------------------
   Home Styling
--------------------------- */
.ongc-home {
    background-color: #000e35;
}

.tile {
  background-color: white !important;
}

/* ---------------------------
   Help Button
--------------------------- */
.help-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background-color: #0078d4; /* Reach blue – adjust as needed */
  color: #fff;
  font-size: 28px;
  font-weight: bold;
  border-radius: 50%;
  text-align: center;
  line-height: 56px;
  text-decoration: none;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  transition: background-color 0.25s, transform 0.2s;
  z-index: 1000;
}

.help-button:hover {
  background-color: #005fa3;
  transform: scale(1.05);
}