/* ==========================================================================
   MEETINGS — Modal de Criação / Edição
   Contém: estilos antigos (compatibilidade) + novo mc-* para meetings-create.js
   ========================================================================== */

/* ────────────────────────────────────────────────────────────────────────────
   LEGACY — classes antigas mantidas para compatibilidade
   ──────────────────────────────────────────────────────────────────────────── */

.modal-large {
  max-width: 680px !important;
  width: 95% !important;
}

.modal-xlarge {
  max-width: 860px !important;
  width: 96% !important;
}

/* Scrollable body da criação */
.meeting-modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(90vh - 200px);
}

/* ── Req counter badge ───────────────────────────────────────────────────── */
.req-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary);
  color: var(--white);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.req-counter-badge.zero {
  background: var(--gray-200);
  color: var(--text-tertiary);
}

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ────────────────────────────────────────────────────────────────────────────
   NOVO — Modal de Criação de Encontros (mc-*)
   meetings-create.js
   ──────────────────────────────────────────────────────────────────────────── */

/* ── Overlay e container do modal ────────────────────────────────────────── */
#mc-modal .mc-modal-content {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  width: 96%;
  max-width: 700px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: mcSlideIn var(--transition-slow) cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mcSlideIn {
  from { transform: translateY(20px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.mc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
  flex-shrink: 0;
}

.mc-modal-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.mc-modal-title h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mc-modal-icon {
  width: 38px;
  height: 38px;
  background: rgba(37, 99, 235, 0.1);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1rem;
  flex-shrink: 0;
}

.mc-modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color);
  background: var(--white);
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.mc-modal-close:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--white);
}

/* ── Body do modal (scroll) ──────────────────────────────────────────────── */
.mc-modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Loading state ───────────────────────────────────────────────────────── */
.mc-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-16) var(--space-6);
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.mc-loading i {
  color: var(--primary);
  font-size: 1.375rem;
}

/* ── Error state ─────────────────────────────────────────────────────────── */
.mc-modal-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--text-secondary);
}

.mc-modal-error i {
  font-size: 2.5rem;
  color: var(--danger);
  opacity: 0.7;
}

.mc-modal-error h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.mc-modal-error p {
  margin: 0;
  font-size: 0.875rem;
}

/* ── Seções do formulário ────────────────────────────────────────────────── */
.mc-section {
  padding-bottom: var(--space-6);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-color);
}

.mc-section--last {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Label de seção */
.mc-section-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-4);
}

.mc-section-label i {
  color: var(--primary);
  font-size: 0.875rem;
}

.mc-optional-label {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-tertiary);
  text-transform: none;
  letter-spacing: 0;
  margin-left: var(--space-1);
}

/* ── Campos do formulário ────────────────────────────────────────────────── */
.mc-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mc-field--full {
  width: 100%;
  margin-bottom: var(--space-4);
}

.mc-field--full:last-child {
  margin-bottom: 0;
}

.mc-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mc-label i {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.mc-required {
  color: var(--danger);
  font-weight: 700;
}

.mc-field-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-tertiary);
  margin-left: var(--space-1);
}

/* ── Inputs de texto ─────────────────────────────────────────────────────── */
.mc-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
  font-family: inherit;
}

.mc-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.mc-input::placeholder {
  color: var(--text-tertiary);
}

/* Título com fonte maior */
.mc-input--title {
  font-size: 1.0625rem;
  font-weight: 600;
  padding: var(--space-4) var(--space-4);
}

/* Grid de 3 colunas para data/hora/local */
.mc-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

/* ── Textareas ───────────────────────────────────────────────────────────── */
.mc-textarea {
  width: 100%;
  padding: var(--space-4);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  min-height: 80px;
}

.mc-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.mc-textarea::placeholder {
  color: var(--text-tertiary);
}

.mc-textarea--lg {
  min-height: 120px;
}

.mc-textarea--md {
  min-height: 96px;
}

.mc-textarea--sm {
  min-height: 72px;
}

/* ── Botão para abrir seletor de requisitos ──────────────────────────────── */
.mc-btn-open-reqs {
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--space-4) var(--space-5);
  background: var(--white);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-xl);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  gap: var(--space-3);
  text-align: left;
}

.mc-btn-open-reqs-icon {
  width: 36px;
  height: 36px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1rem;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}

.mc-btn-open-reqs-text {
  flex: 1;
  text-align: left;
}

.mc-btn-open-reqs-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 var(--space-2);
  background: var(--primary);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.mc-btn-open-reqs-arrow {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  transition: transform var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.mc-btn-open-reqs:hover {
  border-color: var(--primary);
  border-style: solid;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.03);
}

.mc-btn-open-reqs:hover .mc-btn-open-reqs-icon {
  background: rgba(37, 99, 235, 0.15);
}

.mc-btn-open-reqs:hover .mc-btn-open-reqs-arrow {
  transform: translateX(3px);
  color: var(--primary);
}

/* Estado ativo (tem seleção) */
.mc-btn-open-reqs--active {
  border-style: solid;
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.04);
  color: var(--primary);
}

.mc-btn-open-reqs--active .mc-btn-open-reqs-icon {
  background: rgba(37, 99, 235, 0.15);
}

/* ── Pills de requisitos selecionados ────────────────────────────────────── */
.mc-req-pills {
  margin-top: var(--space-3);
}

.mc-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.mc-req-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 10px 5px 8px;
  background: rgba(37, 99, 235, 0.08);
  border: 1.5px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  max-width: 280px;
  animation: pillIn 0.15s ease;
}

@keyframes pillIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.mc-req-pill i {
  font-size: 0.75rem;
  flex-shrink: 0;
  opacity: 0.8;
}

.mc-req-pill-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}

.mc-req-pill-remove {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.15);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
  transition: all var(--transition-fast);
  padding: 0;
}

.mc-req-pill-remove i {
  font-size: 0.6rem;
  opacity: 1;
}

.mc-req-pill-remove:hover {
  background: var(--danger);
  color: var(--white);
}

/* ── Estado vazio de requisitos ──────────────────────────────────────────── */
.mc-reqs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
  background: var(--gray-50);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-tertiary);
}

.mc-reqs-empty i {
  font-size: 1.75rem;
  color: var(--gray-300);
}

.mc-reqs-empty p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.mc-reqs-empty-hint {
  font-size: 0.775rem;
  color: var(--text-tertiary);
}

/* ── Mensagem de erro ────────────────────────────────────────────────────── */
.mc-error-msg {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: rgba(239, 68, 68, 0.06);
  border: 1.5px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--danger);
  margin-bottom: var(--space-4);
}

.mc-error-msg i {
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Footer do modal ─────────────────────────────────────────────────────── */
.mc-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--border-color);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
  flex-shrink: 0;
}

/* ── Botões genéricos (mc-btn) ───────────────────────────────────────────── */
.mc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  border: 1.5px solid;
  font-family: inherit;
}

.mc-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Ghost (Cancelar) */
.mc-btn--ghost {
  background: var(--white);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.mc-btn--ghost:hover:not(:disabled) {
  background: var(--gray-100);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* Primary (Criar / Salvar) */
.mc-btn--primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  border-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  padding: var(--space-3) var(--space-6);
}

.mc-btn--primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.38);
  transform: translateY(-1px);
}

.mc-btn--primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* ── Responsividade ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #mc-modal .mc-modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    margin-top: auto;
  }

  .mc-row-3 {
    grid-template-columns: 1fr 1fr;
  }

  .mc-row-3 > .mc-field:last-child {
    grid-column: 1 / -1;
  }

  .mc-modal-body {
    padding: var(--space-4);
  }

  .mc-footer {
    padding: var(--space-4);
    flex-direction: row;
  }

  .mc-btn--primary {
    flex: 1;
  }
}
