/* ================================
   Create Lecture Modal
================================ */

.tk-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(14px);
}

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

.tk-create-modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 32px;
  box-shadow:
    0 30px 90px rgba(15, 23, 42, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 28px;
}

.tk-create-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.tk-create-modal-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #2563eb;
}

.tk-create-modal-header h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: #0f172a;
}

.tk-create-modal-header p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: #64748b;
}

.tk-modal-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tk-modal-close:hover {
  background: rgba(15, 23, 42, 0.1);
  transform: scale(1.05);
}

.tk-create-modal-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.tk-modal-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tk-modal-field > span {
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
}

.tk-modal-field input[type="text"],
.tk-modal-field input[type="search"],
.tk-modal-field input[type="date"],
.tk-modal-field input[type="time"] {
  width: 100%;
  height: 52px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 18px;
  padding: 0 16px;
  background: rgba(248, 250, 252, 0.9);
  color: #0f172a;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
}

.tk-modal-field input[type="text"]:focus,
.tk-modal-field input[type="search"]:focus,
.tk-modal-field input[type="date"]:focus,
.tk-modal-field input[type="time"]:focus {
  border-color: rgba(37, 99, 235, 0.5);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.tk-modal-mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.tk-modal-mode-btn {
  height: 44px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #475569;
  font-size: 14px;
  font-weight: 950;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tk-modal-mode-btn:hover {
  background: rgba(255, 255, 255, 0.68);
  color: #0f172a;
}

.tk-modal-mode-btn.active {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.tk-modal-schedule-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px;
}

.tk-modal-schedule-grid.is-hidden {
  display: none;
}

.tk-selected-tool-preview {
  min-height: 62px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(240, 253, 250, 0.86));
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  box-sizing: border-box;
}

.tk-selected-tool-summary {
  margin-bottom: 10px;
  color: #1e40af;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: -0.01em;
}

.tk-selected-tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tk-selected-tool-chip {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
  transition: all 0.18s ease;
}

.tk-selected-tool-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

.tk-selected-tool-preview strong {
  display: block;
  margin-bottom: 4px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 950;
}

.tk-selected-tool-preview span {
  display: block;
  color: #64748b;
  line-height: 1.45;
}

.tk-modal-tool-search {
  margin-bottom: 2px;
}

.tk-modal-category-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
}

.tk-modal-category-btn {
  height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.9);
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tk-modal-category-btn:hover {
  background: #fff;
  border-color: rgba(37, 99, 235, 0.35);
  color: #1d4ed8;
}

.tk-modal-category-btn.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
}

.tk-modal-tool-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: 330px;
  overflow-y: auto;
  padding-right: 4px;
}

.tk-modal-tool-list::-webkit-scrollbar {
  width: 8px;
}

.tk-modal-tool-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.42);
  border-radius: 999px;
}

.tk-modal-tool-option {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 22px;
  background: rgba(248, 250, 252, 0.76);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tk-modal-tool-option:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.28);
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.tk-modal-tool-option.is-selected {
  border-color: rgba(37, 99, 235, 0.5);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.95), rgba(240, 253, 250, 0.72));
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.1);
}

.tk-modal-tool-option strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.28;
  color: #0f172a;
}

.tk-modal-tool-option p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tk-modal-tool-select-label {
  align-self: flex-start;
  height: 30px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.07);
  color: #334155;
  font-size: 12px;
  font-weight: 950;
}

.tk-modal-tool-option.is-selected .tk-modal-tool-select-label {
  background: #0f172a;
  color: #fff;
}

.tk-modal-tool-help {
  margin: -2px 0 0;
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.55;
  font-weight: 750;
}

.tk-modal-empty {
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px dashed rgba(148, 163, 184, 0.42);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.7);
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.tk-create-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
}

.tk-modal-secondary-btn,
.tk-modal-primary-btn {
  height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tk-modal-secondary-btn {
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
}

.tk-modal-secondary-btn:hover {
  background: rgba(15, 23, 42, 0.1);
}

.tk-modal-primary-btn {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.26);
}

.tk-modal-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.34);
}

@media (max-width: 640px) {
  .tk-create-modal {
    border-radius: 24px;
    padding: 22px;
  }

  .tk-create-modal-header h2 {
    font-size: 24px;
  }

  .tk-modal-schedule-grid {
    grid-template-columns: 1fr;
  }

  .tk-modal-mode-toggle {
    grid-template-columns: 1fr;
  }

  .tk-modal-tool-list {
    grid-template-columns: 1fr;
  }

  .tk-create-modal-footer {
    flex-direction: column-reverse;
  }

  .tk-modal-secondary-btn,
  .tk-modal-primary-btn {
    width: 100%;
  }
}
