/* Team Hub editor modal refinements */

.drawer.centered.teamhub-editor-drawer {
  width: min(1280px, calc(100vw - 56px));
  height: min(94vh, calc(100vh - 28px));
  max-height: calc(100vh - 28px);
  top: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.94)),
    var(--drawer-bg);
  box-shadow: 0 28px 80px rgba(2, 6, 23, 0.52);
}

.teamhub-editor-drawer .drawer-header {
  min-height: 76px;
  padding: 18px 28px;
  background: rgba(15, 23, 42, 0.96);
}

.teamhub-editor-drawer .drawer-header > div {
  min-width: 0;
}

.teamhub-editor-drawer .drawer-header .card-title {
  font-size: 21px;
  letter-spacing: 0;
}

.teamhub-editor-drawer .drawer-body.teamhub-editor-body {
  padding: 22px 28px 24px;
  background: rgba(15, 23, 42, 0.88);
}

.teamhub-editor-drawer .drawer-footer {
  padding: 18px 28px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.97);
  box-shadow: 0 -16px 36px rgba(2, 6, 23, 0.34);
}

.teamhub-editor-drawer .drawer-footer .btn {
  min-height: 44px;
  padding: 10px 18px;
  font-weight: 700;
}

.teamhub-editor-drawer .btn.outline:hover,
.teamhub-editor-drawer .btn.outline:focus-visible {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(129, 140, 248, 0.58);
  color: var(--text-main);
}

.teamhub-editor-form {
  gap: 14px;
}

.teamhub-editor-top-row {
  display: grid;
  grid-template-columns: minmax(140px, 172px) minmax(0, 1fr);
  gap: 12px;
}

.teamhub-editor-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.teamhub-editor-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.teamhub-field-label {
  display: block;
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.teamhub-editor-field input,
.teamhub-editor-field select,
.teamhub-task-mode-row select {
  min-height: 46px;
  padding: 10px 12px;
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.72);
  font-size: 13px;
}

.teamhub-editor-field--title input {
  font-size: 15px;
  font-weight: 700;
}

.teamhub-ai-btn {
  min-width: 58px;
  min-height: 46px;
  padding: 0 13px !important;
  border-color: rgba(167, 139, 250, 0.72) !important;
  color: #c4b5fd !important;
  white-space: nowrap;
}

.teamhub-task-meta-grid {
  display: grid;
  grid-template-columns:
    minmax(126px, 0.75fr)
    minmax(170px, 1fr)
    minmax(170px, 1fr)
    minmax(260px, 1.35fr);
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(30, 41, 59, 0.34);
}

.teamhub-scope-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.teamhub-scope-segment legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}

.teamhub-scope-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.teamhub-scope-option input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--primary);
}

.teamhub-scope-option.is-selected,
.teamhub-scope-option:has(input:checked) {
  border-color: rgba(129, 140, 248, 0.76);
  background: rgba(99, 102, 241, 0.18);
}

.teamhub-scope-option:focus-within {
  outline: 2px solid rgba(129, 140, 248, 0.55);
  outline-offset: 2px;
}

.teamhub-category-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 6px;
  min-width: 0;
}

.teamhub-icon-btn {
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0 !important;
  border-radius: 12px;
  font-size: 15px !important;
}

.teamhub-datetime-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  min-width: 0;
  height: 46px;
  overflow: hidden;
  border: 1px solid rgba(52, 211, 153, 0.36);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.76);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.teamhub-datetime-picker:focus-within {
  border-color: rgba(52, 211, 153, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 0 4px rgba(45, 212, 191, 0.12);
}

.teamhub-datetime-input {
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color-scheme: dark;
  font-weight: 650;
}

body.light-mode .teamhub-datetime-input {
  color-scheme: light;
}

.teamhub-datetime-input:focus {
  outline: none;
}

.teamhub-datetime-input::-webkit-calendar-picker-indicator {
  display: none;
  opacity: 0;
  -webkit-appearance: none;
}

.teamhub-datetime-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 100%;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.42), rgba(129, 140, 248, 0.34));
  color: #ecfeff;
  font-size: 18px;
  line-height: 1;
}

.teamhub-datetime-button:hover,
.teamhub-datetime-button:focus-visible {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.58), rgba(129, 140, 248, 0.48));
  outline: none;
}

.teamhub-task-mode-row,
.teamhub-excluded-class-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.teamhub-task-mode-row select {
  width: auto;
  min-width: 210px;
}

.teamhub-task-mode-label {
  min-width: 62px;
}

.teamhub-inline-hint {
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.45;
}

.teamhub-excluded-class-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.36);
}

.teamhub-excluded-class-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.teamhub-priority-link-row {
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.teamhub-priority-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.42);
}

.teamhub-priority-stars {
  display: flex;
  gap: 2px;
}

.teamhub-priority-stars .star-rating {
  font-size: 17px;
}

.teamhub-editor-workspace {
  margin-top: 2px;
}

#drawer .easy-md-container {
  min-height: 390px;
}

#drawer .easy-md-textarea,
#drawer .easy-md-preview,
#drawer #body-preview {
  min-height: 390px;
}

@media (max-width: 1040px) {
  .teamhub-task-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .drawer.centered.teamhub-editor-drawer {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh;
    max-height: 100vh;
    top: 0;
    border-radius: 0;
  }

  .teamhub-editor-drawer .drawer-header,
  .teamhub-editor-drawer .drawer-footer,
  .teamhub-editor-drawer .drawer-body.teamhub-editor-body {
    padding: 16px;
  }

  .teamhub-editor-drawer .drawer-header {
    align-items: flex-start;
    gap: 12px;
  }

  .teamhub-editor-drawer .drawer-header > div:last-child {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .teamhub-editor-top-row,
  .teamhub-editor-summary-row,
  .teamhub-task-meta-grid,
  .teamhub-priority-link-row {
    grid-template-columns: 1fr;
  }

  .teamhub-task-mode-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .teamhub-task-mode-row select {
    width: 100%;
    min-width: 0;
  }

  #drawer .easy-md-container,
  #drawer .easy-md-textarea,
  #drawer .easy-md-preview,
  #drawer #body-preview {
    min-height: 330px;
  }
}
