/* ============================================
   FLOWDESK — MODAL STYLES
   ============================================ */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(3,3,7,0.6);
  backdrop-filter: blur(10px) saturate(140%);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  padding: 1rem;
  animation: fadeOverlay 0.2s ease;
}

@keyframes fadeOverlay { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), var(--inset-hi);
  animation: slideUp 0.45s var(--ease);
}

.modal-large { max-width: 780px; }
.modal-sm { max-width: 400px; }

@keyframes slideUp {
  from { transform: translateY(30px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 1.1rem;
  padding: 0.35rem; border-radius: var(--radius-sm);
  transition: var(--transition);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scrollbar-width: thin; scrollbar-color: var(--bg-overlay) transparent;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  flex-shrink: 0;
}

/* === TASK FORM === */
.task-form { display: flex; flex-direction: column; gap: 1rem; }

/* === TASK VIEW MODE (Collaborator) === */
.task-view-mode { display: flex; flex-direction: column; gap: 1.25rem; }

.task-view-header { display: flex; flex-direction: column; gap: 0.75rem; }

.task-view-meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
}

.tag-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px; font-size: 0.78rem; font-weight: 600;
}

.tv-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.task-view-links {
  display: flex; gap: 0.875rem; flex-wrap: wrap;
  padding: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.btn-link-action {
  display: inline-flex; align-items: center; gap: 0.6rem;
  height: 44px; padding: 0 1.25rem;
  flex: 1; justify-content: center; min-width: 160px;
  border-radius: 12px; text-decoration: none;
  font-weight: 500; font-size: 0.86rem; color: #fff;
  background: linear-gradient(180deg, #6d95ff 0%, #4f7dff 52%, #416ff2 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 24px -10px rgba(79, 125, 255, 0.75);
  transition: transform 0.38s var(--spring), box-shadow 0.3s ease, filter 0.3s ease;
}
.btn-link-action:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 16px 32px -10px rgba(79, 125, 255, 0.95); }
.btn-link-action:active { transform: translateY(1px) scale(0.98); }

/* Segundo link (Arte): versão secundária */
.btn-link-action-2 {
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)), var(--bg-elevated);
  border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.btn-link-action-2:hover { filter: none; background: var(--bg-hover); border-color: rgba(255, 255, 255, 0.2); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08); }

.task-view-briefing {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.task-view-briefing h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.task-view-briefing p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

/* === TASK COMMENTS === */
.task-comments-container {
  display: flex; flex-direction: column; gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.comments-list {
  display: flex; flex-direction: column; gap: 0.8rem;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.comment-item {
  display: flex; gap: 0.8rem;
}

.comment-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 0.8rem 1rem;
  flex: 1;
}

.comment-header {
  display: flex; justify-content: space-between;
  margin-bottom: 0.4rem; font-size: 0.75rem;
  color: var(--text-muted);
}

.comment-header strong {
  color: var(--text-primary);
}

.comment-text {
  font-size: 0.85rem; color: var(--text-secondary);
  line-height: 1.5; white-space: pre-wrap;
  word-break: break-word;
}

.comment-input-row {
  display: flex; gap: 0.5rem;
}
