/* src/nextlist/frontend/css/checklist-view.css */

.checklist-view {
  padding: 24px;
  max-width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ─── Header ──────────────────────────────────────────────── */
.checklist-view .page-header-wrapper {
  border: 1px solid var(--border, #e5e7eb);
  margin: -20px -20px 2rem -20px;
  background-color: var(--card-bg, #ffffff);
  padding: 24px 20px;
  margin-bottom: 1.5rem;
}

.checklist-view .checklist-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.checklist-view .checklist-view-header-center {
  flex: 1;
  text-align: center;
}

.checklist-view .cv-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 4px;
}

html.dark-theme .checklist-view .cv-title {
  color: #fff;
}

.checklist-view .cv-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

.checklist-view .cv-back-btn {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  padding: 8px 14px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  white-space: nowrap;
}

.checklist-view .cv-back-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

html.dark-theme .checklist-view .cv-back-btn {
  color: #e5e7eb;
  border-color: #374151;
  background: transparent;
}

html.dark-theme .checklist-view .cv-back-btn:hover {
  background: #1f2937;
}

.checklist-view .cv-header-actions {
  display: flex;
  gap: 8px;
}

.checklist-view .cv-btn-pdf {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  padding: 8px 14px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  white-space: nowrap;
}

.checklist-view .cv-btn-pdf:hover {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #ea580c;
}

/* ─── Container principal ─────────────────────────────────── */
.checklist-view .cv-main-container {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0 0 12px 12px;
  background-color: var(--card-bg, #ffffff);
  margin: 0 -24px;
  padding: 24px 32px;
}

html.dark-theme .checklist-view .cv-main-container {
  background-color: var(--background-dark-mode);
  border-color: #374151;
}

/* ─── Erro ────────────────────────────────────────────────── */
.checklist-view .cv-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 12px;
  color: #6b7280;
  font-size: 14px;
}

.checklist-view .cv-error-icon {
  font-size: 36px;
}

/* ─── Resumo ──────────────────────────────────────────────── */
.checklist-view .cv-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .checklist-view .cv-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

.checklist-view .cv-summary-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

html.dark-theme .checklist-view .cv-summary-item {
  background: var(--surface-dark-mode, #1f2937);
  border-color: #374151;
}

.checklist-view .cv-summary-label {
  font-size: 10px;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.checklist-view .cv-summary-value {
  font-size: 20px;
  font-weight: 700;
  color: #f97316;
}

.checklist-view .cv-summary-value.cv-duration {
  font-size: 16px;
}

/* ─── Info block ──────────────────────────────────────────── */
.checklist-view .cv-info-block {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 24px;
}

html.dark-theme .checklist-view .cv-info-block {
  background: var(--surface-dark-mode, #1f2937);
  border-color: #374151;
}

@media (max-width: 600px) {
  .checklist-view .cv-info-block {
    grid-template-columns: 1fr;
  }
}

.checklist-view .cv-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checklist-view .cv-info-label {
  font-size: 10px;
  text-transform: uppercase;
  color: #9ca3af;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.checklist-view .cv-info-value {
  font-size: 13px;
  color: #111827;
  font-weight: 500;
}

html.dark-theme .checklist-view .cv-info-value {
  color: #e5e7eb;
}

/* ─── Seções ──────────────────────────────────────────────── */
.checklist-view .cv-section {
  margin-bottom: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

html.dark-theme .checklist-view .cv-section {
  border-color: #374151;
}

.checklist-view .cv-section-header {
  background: #f3f4f6;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
}

html.dark-theme .checklist-view .cv-section-header {
  background: var(--surface-dark-mode, #1f2937);
  border-color: #374151;
}

.checklist-view .cv-section-name {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

html.dark-theme .checklist-view .cv-section-name {
  color: #fff;
}

.checklist-view .cv-section-description {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.checklist-view .cv-section-count {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 500;
  white-space: nowrap;
}

/* ─── Campos ──────────────────────────────────────────────── */
.checklist-view .cv-field {
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
  background: #fff;
}

html.dark-theme .checklist-view .cv-field {
  background: var(--background-dark-mode);
  border-color: #374151;
}

.checklist-view .cv-field:last-child {
  border-bottom: none;
}

.checklist-view .cv-field-nc {
  background: #fff5f5;
  border-left: 3px solid #ef4444;
}

html.dark-theme .checklist-view .cv-field-nc {
  background: #1f1010;
}

.checklist-view .cv-field-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.checklist-view .cv-required-star {
  color: #ef4444;
}

.checklist-view .cv-nc-tag {
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 4px;
}

.checklist-view .cv-field-value {
  font-size: 13px;
  color: #111827;
  line-height: 1.6;
}

html.dark-theme .checklist-view .cv-field-value {
  color: #e5e7eb;
}

.checklist-view .cv-not-answered {
  color: #9ca3af;
  font-style: italic;
}

.checklist-view .cv-nc-notes {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fee2e2;
  border-radius: 6px;
  font-size: 12px;
  color: #dc2626;
}

/* ─── Mídias ──────────────────────────────────────────────── */

/* ─── Mídias ──────────────────────────────────────────────── */
.checklist-view .cv-media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.checklist-view .cv-media-item {
  width: 140px;
  height: 105px;
  border-radius: 6px;
  border-left: 3px solid var(--primary-color);
  border-top: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease;
  position: relative;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checklist-view .cv-media-item:not(.cv-media-expanded):hover {
  transform: scale(1.03);
  border-color: var(--primary-color);
}

.checklist-view .cv-media-item.cv-media-expanded {
  width: 100%;
  height: auto;
  border-color: var(--primary-color);
  overflow: visible;
}

.checklist-view .cv-media-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.checklist-view .cv-media-item.cv-media-expanded .cv-media-thumb {
  height: auto;
  max-height: 400px;
  object-fit: contain;
}

.checklist-view .cv-media-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checklist-view .cv-media-item.cv-media-expanded .cv-media-video {
  height: auto;
  max-height: 400px;
}

.checklist-view .cv-audio-icon {
  font-size: 32px;
  pointer-events: none;
}

.checklist-view .cv-media-item.cv-media-expanded .cv-audio-icon {
  display: none;
}

.checklist-view .cv-media-audio {
  display: none;
  width: 100%;
}

.checklist-view .cv-media-item.cv-media-expanded .cv-media-audio {
  display: block;
}

.checklist-view .cv-file-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fff7ed;
  border-left: 3px solid var(--primary-color);
  border-top: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  color: #ea580c;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
  margin: 4px 0;
}

.checklist-view .cv-file-download:hover {
  border-color: var(--primary-color);
  background: #ffedd5;
}

/* ─── Campo com mídia ─────────────────────────────────────── */
.checklist-view .cv-field:has(.cv-media-grid) {
  border-left: 3px solid var(--primary-color);
}

html.dark-theme .checklist-view .cv-media-item {
  background: #1f2937;
  border-top-color: #374151;
  border-right-color: #374151;
  border-bottom-color: #374151;
}

html.dark-theme .checklist-view .cv-media-badge {
  background: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}

.checklist-view .cv-file-download:hover {
  background: #ffedd5;
}

/* ─── Yes/No ──────────────────────────────────────────────── */
.checklist-view .cv-yes {
  color: #10b981;
  font-weight: 700;
  font-size: 14px;
}

.checklist-view .cv-no {
  color: #ef4444;
  font-weight: 700;
  font-size: 14px;
}

.checklist-view .cv-yesno-text {
  margin-top: 6px;
  font-size: 13px;
  color: #374151;
  padding: 8px 10px;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

html.dark-theme .checklist-view .cv-yesno-text {
  background: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}

/* ─── Chips (múltipla escolha) ────────────────────────────── */
.checklist-view .cv-chip {
  display: inline-block;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 12px;
  color: #374151;
  margin: 2px 4px 2px 0;
}

html.dark-theme .checklist-view .cv-chip {
  background: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}

/* ─── GPS ─────────────────────────────────────────────────── */
.checklist-view .cv-gps {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #374151;
}

html.dark-theme .checklist-view .cv-gps {
  color: #e5e7eb;
}

/* ─── Lightbox ────────────────────────────────────────────── */
.checklist-view .cv-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checklist-view .cv-lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.checklist-view .cv-lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
}

.checklist-view .cv-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.checklist-view .cv-lightbox-close {
  position: absolute;
  top: -40px;
  right: -25px;
  background: var(--primary-color);
  border: none;
  color: #fff;
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
  opacity: 1;
}

.checklist-view .cv-lightbox-close:hover {
  transform: scale(1.15);
  opacity: 0.85;
}

/* ─── Lightbox vídeo ──────────────────────────────────────── */
#cv-lightbox-video {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  display: block;
  background: #000;
}

/* ─── Assinatura no lightbox ──────────────────────────────── */
.cv-lightbox-content:has(img[alt="Assinatura"]) {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  max-width: 420px;
}

.cv-lightbox-content:has(img[alt="Assinatura"]) .cv-lightbox-img {
  max-width: 380px;
  max-height: 200px;
  object-fit: contain;
}

.cv-lightbox-content:has(img[alt="Assinatura"]) .cv-lightbox-close {
  top: -44px;
}

/* ─── Botão fechar mídia expandida ───────────────────────── */
.checklist-view .cv-media-close-btn {
  display: block;
  margin-bottom: -10px;
  margin-top: 4px;
  margin-left: auto;
  position: static;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  color: #fff;
  font-size: 13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s;
}

.checklist-view .cv-media-close-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* ─── Player externo ──────────────────────────────────────── */
.checklist-view .cv-external-player {
  width: 100%;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checklist-view .cv-external-player .cv-media-player {
  width: 100%;
}

.checklist-view .cv-external-player .cv-media-close-btn {
  position: static;
  margin-left: auto;
  margin-bottom: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-color);
  border: none;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
  opacity: 1;
}
.checklist-view .cv-external-player .cv-media-close-btn:hover {
  transform: scale(1.15);
  opacity: 0.85;
}

.checklist-view .cv-lightbox-img[src^="data:"] {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
}

/* ─── Photo Lightbox (múltiplas fotos) ────────────────────── */
.cv-photo-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-photo-lightbox {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 90vw;
  max-height: 90vh;
}

.cv-photo-lightbox-close {
  position: absolute;
  top: -44px;
  right: -8px;
  background: var(--primary-color, #f97316);
  border: none;
  color: #fff;
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-photo-lightbox-close:hover { opacity: 0.85; }

.cv-photo-lightbox-thumbs-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cv-photo-lightbox-thumbs {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
  max-width: 80vw;
}

.cv-photo-lightbox-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.cv-photo-lightbox-thumb.active,
.cv-photo-lightbox-thumb:hover {
  opacity: 1;
  border-color: var(--primary-color, #f97316);
}

.cv-photo-lightbox-arrow {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cv-photo-lightbox-arrow:hover { background: rgba(255,255,255,0.3); }

.cv-photo-lightbox-main img {
  max-width: 82vw;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}
