/* ============================================================
   ESTILOS BASE (COMUM A TODOS OS MODAIS)
   ============================================================ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99999;
  justify-content: center;
  align-items: center;
}

/* PMI Modals - Não esconder o conteúdo interno */
.modal-overlay .pmi-modal,
#pmi-modal .pmi-modal,
#pmi-viewer-modal .pmi-modal {
  display: block !important;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  width: 95%;
  max-width: 700px !important;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.3rem;
  margin: 0;
  color: #333;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #999;
}

.modal-body {
  padding: 25px;
}

.modal-footer {
  padding: 20px 25px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ============================================================
   ESTILO ESPECÍFICO: MODAL NOVO PROJETO (Grade 3-3-1)
   ============================================================ */
#new-project-modal .project-categories-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 12px !important;
  margin: 20px 0 !important;
}

/* Centraliza o Blog (7º item) */
#new-project-modal .category-option:nth-child(7) {
  grid-column: 2 !important;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px 5px;
  border: 2px solid #f0f0f0;
  border-radius: 12px;
  height: 90px;
}

#new-project-modal i {
  color: #4361ee;
  font-size: 1.4rem;
  margin-bottom: 8px;
}

/* Fix para ícones de marca (Google, Facebook, etc) */
#new-project-modal i.fab {
  font-family: "Font Awesome 6 Brands" !important;
  font-weight: 400 !important;
}

/* ============================================================
   ESTILO ESPECÍFICO: MODAL APRESENTAÇÃO (Templates)
   ============================================================ */
#presentation-modal .template-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  /* Duas colunas para templates */
  gap: 15px !important;
  margin-top: 15px;
}

.template-card {
  border: 2px solid #f0f0f0;
  border-radius: 12px;
  padding: 15px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.template-card:hover {
  border-color: #4361ee;
  background: #f0f4ff;
}

/* ============================================================
   BOTÕES PADRONIZADOS
   ============================================================ */
.modal-btn.primary {
  background: linear-gradient(135deg, #4361ee 0%, #7209b7 100%) !important;
  color: white !important;
  min-width: 160px;
  height: 46px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
}

.modal-btn.secondary {
  background: white !important;
  color: #4361ee !important;
  border: 2px solid #4361ee !important;
  min-width: 120px;
  height: 46px;
  border-radius: 10px;
  font-weight: 600;
}

/* ============================================================
   PDF EXPORT MODAL STYLES
   ============================================================ */

.pdf-export-modal-content {
  max-width: 700px;
}

.pdf-step {
  margin-bottom: 25px;
}

.pdf-step-title {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #4361ee;
  display: inline-block;
}

/* Style Cards Grid */
.pdf-styles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.pdf-style-card {
  background: #f8f9fa;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.pdf-style-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pdf-style-card.selected {
  border-color: #4361ee;
  background: #f0f4ff;
}

.style-preview {
  width: 100%;
  height: 60px;
  border-radius: 8px;
  margin-bottom: 8px;
}

/* Style Preview Colors */
.formal-preview {
  background: linear-gradient(135deg, #1a365d 0%, #2c5282 50%, #3182ce 100%);
}

.institucional-preview {
  background: linear-gradient(135deg, #4361ee 0%, #667eea 50%, #7c3aed 100%);
}

.descolado-preview {
  background: linear-gradient(135deg, #f857a6 0%, #ff5858 50%, #f09819 100%);
}

.alegre-preview {
  background: linear-gradient(135deg, #00b894 0%, #00cec9 50%, #0984e3 100%);
}

.clean-preview {
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 50%, #e0e0e0 100%);
  border: 1px solid #ddd;
}

.dark-preview {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.style-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
}

/* Model Cards Grid */
.pdf-models-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.pdf-model-card {
  background: #f8f9fa;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.pdf-model-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pdf-model-card.selected {
  border-color: #4361ee;
  background: #f0f4ff;
}

.model-preview {
  width: 100%;
  height: 80px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-color: #e0e0e0;
  margin-bottom: 8px;
}

.model-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #333;
}

/* Logo Upload Area */
.logo-upload-area {
  border: 2px dashed #ccc;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafafa;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-upload-area:hover,
.logo-upload-area.dragover {
  border-color: #4361ee;
  background: #f0f4ff;
}

.logo-upload-content {
  color: #666;
}

.logo-upload-content i {
  font-size: 2.5rem;
  color: #4361ee;
  margin-bottom: 10px;
}

.logo-upload-content p {
  margin: 10px 0 5px;
  font-size: 0.95rem;
}

.logo-format-hint {
  font-size: 0.75rem;
  color: #999;
}

.logo-preview {
  max-width: 207px;
  max-height: 105px;
  border-radius: 8px;
}

.remove-logo-btn {
  margin-top: 10px;
  background: #fff;
  border: 1px solid #e74c3c;
  color: #e74c3c;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.remove-logo-btn:hover {
  background: #e74c3c;
  color: #fff;
}

/* Dark Mode Support */
[data-theme="dark"] .pdf-style-card,
[data-theme="dark"] .pdf-model-card {
  background: #2d2d2d;
}

[data-theme="dark"] .pdf-style-card.selected,
[data-theme="dark"] .pdf-model-card.selected {
  background: #1a2744;
}

[data-theme="dark"] .style-name,
[data-theme="dark"] .model-name,
[data-theme="dark"] .pdf-step-title {
  color: #e0e0e0;
}

[data-theme="dark"] .logo-upload-area {
  background: #2d2d2d;
  border-color: #444;
}

[data-theme="dark"] .logo-upload-content {
  color: #aaa;
}

/* Responsive */
@media (max-width: 600px) {
  .pdf-styles-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pdf-models-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   PRINT MODAL STYLES
   ============================================================ */

.print-description {
  color: #666;
  margin-bottom: 15px;
  font-size: 0.95rem;
}

.print-categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.print-category-option {
  display: block;
  cursor: pointer;
}

.print-category-option input[type="checkbox"] {
  display: none;
}

.print-cat-card {
  background: #f8f9fa;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  transition: all 0.2s ease;
  font-weight: 500;
  color: #333;
}

.print-category-option input:checked + .print-cat-card {
  border-color: #4361ee;
  background: #f0f4ff;
  color: #4361ee;
}

.print-cat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.print-options {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.print-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #333;
}

.print-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #4361ee;
}

[data-theme="dark"] .print-description {
  color: #aaa;
}

[data-theme="dark"] .print-cat-card,
[data-theme="dark"] .print-options {
  background: #2d2d2d;
  color: #e0e0e0;
}

[data-theme="dark"] .print-category-option input:checked + .print-cat-card {
  background: #1a2744;
  color: #7a9ff4;
}

[data-theme="dark"] .print-option {
  color: #ccc;
}

.current-category-info {
  background: linear-gradient(135deg, #4361ee 0%, #7209b7 100%);
  padding: 15px 20px;
  border-radius: 10px;
  text-align: center;
  margin-bottom: 15px;
}

.current-category-info p {
  color: #fff;
  margin: 0;
  font-size: 1rem;
}

.current-category-info strong {
  font-size: 1.2rem;
  font-weight: 700;
}

@media (max-width: 500px) {
  .print-categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
