/* Backend Styles for RWB TC Plugin */

#tc-properties-admin {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  max-width: 1200px;
  margin: 20px auto;
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

#tc-properties-admin h3 {
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 20px;
  display: inline-block;
}

/* Header Section */
.tc-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
  border-bottom: 1px solid #eee;
  padding-bottom: 20px;
}

.tc-admin-org-label {
  font-size: 14px;
  color: #6c757d;
  font-weight: 500;
}

.tc-add-new-btn {
  background-color: #B953FF;
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  font-family: "HK Grotesk", sans-serif;
  font-weight: 800;
  font-size: 16px;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tc-add-new-btn:hover {
  background-color: #7F1CD0;
}

/* Table Styles */
#tc-properties-admin table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

#tc-properties-admin th {
  text-align: left;
  padding: 15px;
  background-color: #f8f9fa;
  color: #6c757d;
  font-weight: 600;
  border-bottom: 2px solid #e9ecef;
}

#tc-properties-admin th.sortable {
  cursor: pointer;
  user-select: none;
}

#tc-properties-admin th.sortable:hover {
  background-color: #e2e6ea;
  color: #495057;
}

#tc-properties-admin th.sortable i {
  margin-left: 5px;
  color: #adb5bd;
}

#tc-properties-admin th.sortable:hover i {
  color: #6c757d;
}

#tc-properties-admin td {
  padding: 15px;
  border-bottom: 1px solid #e9ecef;
  color: #333;
}

#tc-properties-admin tr:last-child td {
  border-bottom: none;
}

#tc-properties-admin tr:hover td {
  background-color: #f8f9fa;
}

/* Action Buttons */
.tc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.tc-properties-edit,
.tc-properties-calendar,
.tc-properties-delete {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s;
  color: #6c757d;
  font-size: 16px;
}

.tc-properties-edit:focus,
.tc-properties-calendar:focus,
.tc-properties-delete:focus {
  border: none !important;
  outline: none !important;
}

.tc-properties-edit {
  color: #413959;
}

.tc-properties-edit:hover {
  color: #6a5acd;
}

.tc-properties-calendar {
  color: #2e7d32;
}

.tc-properties-calendar:hover {
  color: #1b5e20;
}

.tc-properties-delete {
  color: #ef4c4c;
}

.tc-properties-delete:hover {
  color: #c0392b;
}

/* Modal Styles */
.tc-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

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

.tc-modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 0;
  border: 1px solid #888;
  width: 100%;
  max-width: 500px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s ease-out;
}

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

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

.tc-modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tc-modal-header h4 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

.tc-modal-close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

.tc-modal-close:hover,
.tc-modal-close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

.tc-modal-body {
  padding: 25px;
}

/* Form Styles */
#tc-properties-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #495057;
}

#tc-properties-form input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

#tc-properties-form input[type="text"]:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.tc-form-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.tc-btn-save {
  background-color: #B953FF !important;
  color: white;
  border: none !important;
  padding: 10px 40px !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
}

.tc-btn-save:hover {
  background-color: #7F1CD0 !important;
}

.tc-btn-cancel {
  background-color: transparent;
  color: #413959;
  border: none !important;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
}

.tc-btn-cancel:hover {
  background-color: #f7fafc;
  color: #4a5568;
}

/* Access Denied Styles */
.access-denied-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 40px;
  min-height: 400px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin: 40px auto;
  max-width: 600px;
}

.access-denied-icon {
  font-size: 64px;
  color: #B953FF;
  margin-bottom: 24px;
  opacity: 0.9;
}

.access-denied-heading {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 32px;
  color: #413959;
  margin: 0 0 16px 0;
}

.access-denied-message {
  font-family: "HK Grotesk", sans-serif;
  font-weight: 500;
  font-size: 18px;
  color: #413959;
  margin: 0 0 12px 0;
  line-height: 1.6;
}

.access-denied-support {
  font-family: "HK Grotesk", sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: #41395980;
  margin: 0 0 32px 0;
  line-height: 1.6;
}

.access-denied-button {
  display: inline-block;
  background-color: #B953FF;
  color: white !important;
  font-family: "HK Grotesk", sans-serif;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  padding: 12px 32px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.access-denied-button:hover {
  background-color: #7F1CD0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(185, 83, 255, 0.3);
  text-decoration: none;
  color: white !important;
}

.access-denied-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(185, 83, 255, 0.2);
}

/* Availability (Calendar) modal */
.tc-availability-modal-content {
  max-width: 820px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.tc-availability-modal-content .tc-modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tc-availability-hint {
  color: #6c757d;
  font-size: 13px;
  margin: 0 0 16px 0;
}

.tc-availability-error {
  background: #fdecec;
  border: 1px solid #f5c2c7;
  border-left: 4px solid #d9534f;
  color: #842029;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 16px 0;
}

.tc-availability-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.tc-availability-summary {
  margin-left: auto;
  color: #495057;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.tc-btn-jump-last {
  background: none;
  border: 1px solid #dee2e6;
  color: #6b7280;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.tc-btn-jump-last:hover {
  color: #7c3aed;
  border-color: #c4b5fd;
}

.tc-availability-state {
  color: #6c757d;
  font-size: 13px;
  font-style: italic;
  margin: 0 0 8px 0;
  padding: 4px 2px;
}

/* [hidden] comes from the UA stylesheet, so any theme rule that sets display on
   a button or span outranks it. Restate it at author level for these three. */
.tc-availability-error[hidden],
.tc-availability-state[hidden],
.tc-btn-jump-last[hidden] {
  display: none;
}

/* The save button is disabled until the saved dates are on screen, so that a
   save cannot overwrite a build-out the operator never got to see. */
.tc-btn-save[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.tc-btn-add-date {
  background: #e9ecef;
  color: #495057;
  border: 1px solid #dee2e6;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
}

.tc-btn-add-date:hover {
  background: #dee2e6;
}

.tc-availability-list {
  max-height: 640px;
  min-height: 280px;
  overflow-y: auto;
  margin-bottom: 20px;
  flex: 1 1 auto;
}

.tc-availability-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 8px;
}

.tc-availability-row input[type="date"] {
  padding: 8px 10px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  min-width: 140px;
  flex-shrink: 0;
}

.tc-availability-slots {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.tc-availability-slot {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  background: #413959;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  white-space: nowrap;
}

.tc-availability-slot-remove {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
}

.tc-availability-slot-remove:hover {
  color: #f8d7da;
}

.tc-availability-add-slot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tc-availability-add-slot input.tc-av-time-input {
  min-width: 64px;
  width: 64px;
  padding: 4px 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 13px;
}

.tc-availability-add-slot select.tc-av-ampm {
  padding: 4px 6px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 13px;
  min-width: 52px;
}

.tc-availability-add-slot button {
  padding: 4px 10px;
  background: #B953FF;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.tc-availability-add-slot button:hover {
  background: #7F1CD0;
}

.tc-availability-row-remove {
  background: none;
  border: none;
  color: #ef4c4c;
  cursor: pointer;
  padding: 4px;
}

.tc-availability-row-remove:hover {
  color: #c0392b;
}

.tc-availability-row-duplicate {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
}

.tc-availability-row-duplicate:hover {
  color: #7c3aed;
}