/* ===== PLANO DE MÍDIA INTELIGENTE (PMI) STYLES ===== */

/* Modal Overlay Base - REQUIRED for modal to display */
#pmi-modal,
#pmi-viewer-modal,
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow-y: auto !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

#pmi-modal[style*="display: none"],
#pmi-viewer-modal[style*="display: none"],
.modal-overlay[style*="display: none"] {
    display: none !important;
}

/* Modal do PMI */
.pmi-modal {
    background: white !important;
    border-radius: 16px !important;
    max-width: 850px !important;
    width: 95% !important;
    max-height: 90vh;
    overflow-y: auto;
    position: relative !important;
    margin: auto !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4) !important;
}

.pmi-modal-content {
  padding: 0;
}

/* Close button */
.pmi-modal .modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
  z-index: 10;
}

.pmi-modal .modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.pmi-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 25px 30px;
  color: white;
  border-radius: 12px 12px 0 0;
}

.pmi-header h2 {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white !important;
}

.pmi-header p {
  margin: 0;
  opacity: 0.9;
  font-size: 0.95rem;
  color: white !important;
}

.pmi-body {
  padding: 30px;
}

/* Viewer body should have less padding */
.pmi-viewer .pmi-body {
  padding: 20px;
  padding-bottom: 10px;
}

/* Questions Container */
.pmi-question {
  margin-bottom: 25px;
}

.pmi-question:last-child {
  margin-bottom: 0;
}

.pmi-question-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pmi-question-label .step-num {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Radio Options Grid */
.pmi-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.pmi-option {
  position: relative;
}

.pmi-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pmi-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px 12px;
  background: #f8f9fa;
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.pmi-option label:hover {
  border-color: #667eea;
  background: #f0f4ff;
}

.pmi-option input:checked + label {
  border-color: #667eea;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1) 0%,
    rgba(118, 75, 162, 0.1) 100%
  );
}

.pmi-option .option-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.pmi-option .option-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
}

/* Budget Input */
.pmi-budget-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pmi-budget-input .currency {
  font-size: 1rem;
  font-weight: 600;
  color: #667eea;
}

.pmi-budget-input input {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.pmi-budget-input input:focus {
  border-color: #667eea;
  outline: none;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Footer Buttons */
.pmi-footer {
  padding: 20px 30px;
  background: #f8f9fa;
  border-radius: 0 0 12px 12px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.pmi-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pmi-btn-secondary {
  background: white;
  color: #555;
  border: 2px solid #e1e5e9;
}

.pmi-btn-secondary:hover {
  background: #f0f0f0;
}

.pmi-btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.pmi-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.pmi-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ===== CENÁRIOS VIEW ===== */

.pmi-scenarios-container {
  padding: 30px;
}

.pmi-scenarios-header {
  text-align: center;
  margin-bottom: 30px;
}

.pmi-scenarios-header h3 {
  font-size: 1.4rem;
  margin: 0 0 8px 0;
  color: #333;
}

.pmi-scenarios-header p {
  color: #666;
  margin: 0;
}

/* Scenario Cards Grid */
.pmi-scenarios-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.pmi-scenario-card {
  background: white;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.pmi-scenario-card:hover {
  border-color: #667eea;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.pmi-scenario-card.recommended {
  border-color: #28a745;
}

.pmi-scenario-card.selected {
  border-color: #667eea;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.05) 0%,
    rgba(118, 75, 162, 0.05) 100%
  );
}

.pmi-scenario-badge {
  position: absolute;
  top: -10px;
  right: 15px;
  background: #28a745;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.pmi-scenario-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
  text-transform: capitalize;
}

.pmi-scenario-desc {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 15px;
  line-height: 1.4;
}

.pmi-scenario-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.pmi-stat {
  text-align: center;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
}

.pmi-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
}

.pmi-stat-label {
  font-size: 0.7rem;
  color: #888;
  text-transform: uppercase;
}

/* Allocation Table */
.pmi-allocation-section {
  margin-top: 30px;
}

.pmi-allocation-section h4 {
  font-size: 1rem;
  margin-bottom: 15px;
  color: #333;
}

.pmi-allocation-table {
  width: 100%;
  border-collapse: collapse;
}

.pmi-allocation-table th,
.pmi-allocation-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #e1e5e9;
}

.pmi-allocation-table th {
  background: #f8f9fa;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #666;
}

.pmi-allocation-table tr:hover {
  background: #f8f9fa;
}

.pmi-channel-name {
  font-weight: 600;
  color: #333;
}

.pmi-channel-type {
  font-size: 0.75rem;
  color: #888;
}

.pmi-budget-value {
  font-weight: 700;
  color: #667eea;
}

.pmi-percentage {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

.pmi-recommendation {
  font-size: 0.8rem;
  color: #555;
  max-width: 200px;
}

.pmi-not-advised {
  opacity: 0.5;
}

.pmi-not-advised .pmi-channel-name::after {
  content: " ⚠️";
  font-size: 0.9rem;
}

/* Projections Box */
.pmi-projections {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 25px;
  color: white;
  margin-top: 30px;
}

.pmi-projections h4 {
  margin: 0 0 20px 0;
  font-size: 1rem;
  opacity: 0.9;
}

.pmi-projections-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.pmi-projection-item {
  text-align: center;
}

.pmi-projection-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.pmi-projection-label {
  font-size: 0.75rem;
  opacity: 0.8;
  text-transform: uppercase;
}

/* Justifications */
.pmi-justifications {
  margin-top: 25px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
}

.pmi-justifications h5 {
  margin: 0 0 12px 0;
  font-size: 0.9rem;
  color: #555;
}

.pmi-justifications ul {
  margin: 0;
  padding-left: 20px;
}

.pmi-justifications li {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 6px;
}

/* Button in Project Card - Plano de Mídia */
.btn-create-pmi {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
  border: none !important;
  padding: 0.5rem 1rem !important;
  border-radius: 8px !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.4rem !important;
  transition: all 0.2s ease !important;
  width: 140px !important;
  min-width: 140px !important;
  max-width: 140px !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

.btn-create-pmi:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Share Button */
.pmi-btn-share {
  background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
  color: white;
  border: none;
  cursor: pointer;
}

.pmi-btn-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4);
}

/* Dark Theme */
[data-theme="dark"] .pmi-body {
  background: #2d2d2d;
}

[data-theme="dark"] .pmi-question-label {
  color: #e8eaed;
}

[data-theme="dark"] .pmi-option label {
  background: #3c4043;
  border-color: #5f6368;
  color: #e8eaed;
}

[data-theme="dark"] .pmi-option label:hover {
  border-color: #8ab4f8;
  background: #424548;
}

[data-theme="dark"] .pmi-option input:checked + label {
  border-color: #8ab4f8;
}

[data-theme="dark"] .pmi-option .option-text {
  color: #e8eaed;
}

[data-theme="dark"] .pmi-budget-input input {
  background: #3c4043;
  border-color: #5f6368;
  color: #e8eaed;
}

[data-theme="dark"] .pmi-footer {
  background: #3c4043;
}

[data-theme="dark"] .pmi-scenario-card {
  background: #2d2d2d;
  border-color: #5f6368;
}

[data-theme="dark"] .pmi-scenario-name {
  color: #e8eaed;
}

[data-theme="dark"] .pmi-scenario-desc {
  color: #9aa0a6;
}

[data-theme="dark"] .pmi-stat {
  background: #3c4043;
}

[data-theme="dark"] .pmi-stat-value {
  color: #e8eaed;
}

[data-theme="dark"] .pmi-allocation-table th {
  background: #3c4043;
  color: #9aa0a6;
}

[data-theme="dark"] .pmi-allocation-table td {
  border-color: #5f6368;
}

[data-theme="dark"] .pmi-channel-name {
  color: #e8eaed;
}

[data-theme="dark"] .pmi-justifications {
  background: #3c4043;
}

[data-theme="dark"] .pmi-justifications h5 {
  color: #e8eaed;
}

[data-theme="dark"] .pmi-justifications li {
  color: #9aa0a6;
}

/* Categorized Justifications */
.pmi-justification-group {
  margin-bottom: 16px;
}

.pmi-justification-group:last-child {
  margin-bottom: 0;
}

.pmi-justification-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.pmi-justification-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.pmi-justification-desc {
  font-size: 0.75rem;
  color: #888;
  font-style: italic;
}

.pmi-justification-items {
  margin: 0;
  padding-left: 20px;
}

.pmi-justification-items li {
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: #555;
  line-height: 1.4;
}

/* Dark Theme for Categorized Justifications */
[data-theme="dark"] .pmi-justification-desc {
  color: #9aa0a6;
}

[data-theme="dark"] .pmi-justification-items li {
  color: #bbb;
}

/* Responsive */
@media (max-width: 768px) {
  .pmi-scenarios-grid {
    grid-template-columns: 1fr;
  }

  .pmi-projections-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pmi-allocation-table {
    font-size: 0.85rem;
  }

  .pmi-recommendation {
    display: none;
  }
}

/* ===== STRATEGIES SECTIONS STYLES ===== */

.pmi-strategies,
.pmi-ad-types,
.pmi-category-tips {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
}

.pmi-strategies h5,
.pmi-ad-types h5,
.pmi-category-tips h5 {
  margin: 0 0 15px 0;
  font-size: 1rem;
  color: #333;
}

.pmi-strategies ul,
.pmi-ad-types ul {
  margin: 0;
  padding-left: 20px;
}

.pmi-strategies li,
.pmi-ad-types li {
  margin-bottom: 8px;
  line-height: 1.4;
  color: #555;
}

/* Ad Types */
.pmi-channel-ads {
  background: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 12px;
  border-left: 4px solid #667eea;
}

.pmi-channel-ads strong {
  color: #333;
  font-size: 0.95rem;
}

.pmi-channel-ads ul {
  margin-top: 10px;
  margin-bottom: 0;
}

.pmi-ad-type {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Category Tips */
.pmi-category-section {
  background: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 12px;
  border-left: 4px solid #28a745;
}

.pmi-category-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #28a745;
  margin-bottom: 10px;
}

.pmi-category-strategies,
.pmi-category-ux {
  margin-bottom: 10px;
}

.pmi-category-strategies strong,
.pmi-category-ux strong {
  color: #555;
  font-size: 0.85rem;
}

.pmi-category-strategies ul,
.pmi-category-ux ul {
  margin: 8px 0 0 0;
  padding-left: 18px;
}

.pmi-category-strategies li,
.pmi-category-ux li {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 4px;
}

/* Dark Theme */
[data-theme="dark"] .pmi-strategies,
[data-theme="dark"] .pmi-ad-types,
[data-theme="dark"] .pmi-category-tips {
  background: #2d2d2d;
}

[data-theme="dark"] .pmi-strategies h5,
[data-theme="dark"] .pmi-ad-types h5,
[data-theme="dark"] .pmi-category-tips h5 {
  color: #e8eaed;
}

[data-theme="dark"] .pmi-strategies li,
[data-theme="dark"] .pmi-ad-types li {
  color: #bbb;
}

[data-theme="dark"] .pmi-channel-ads,
[data-theme="dark"] .pmi-category-section {
  background: #3c4043;
}

[data-theme="dark"] .pmi-channel-ads strong {
  color: #e8eaed;
}

[data-theme="dark"] .pmi-category-strategies strong,
[data-theme="dark"] .pmi-category-ux strong {
  color: #bbb;
}

[data-theme="dark"] .pmi-category-strategies li,
[data-theme="dark"] .pmi-category-ux li {
  color: #999;
}

/* ===== PLANS VIEWER STYLES ===== */

.pmi-viewer {
  max-width: 700px;
  height: auto !important;
  max-height: 90vh;
  overflow-y: auto;
}

.pmi-plans-list {
  min-height: auto;
  padding-bottom: 0;
}

.pmi-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.pmi-plan-card {
  background: white;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pmi-plan-card:hover {
  border-color: #667eea;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.pmi-plan-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.2s ease;
  opacity: 0;
  z-index: 10;
}

.pmi-plan-card:hover .pmi-plan-delete {
  opacity: 1;
}

.pmi-plan-delete:hover {
  background: #dc3545;
  color: white;
  transform: scale(1.1);
}

[data-theme="dark"] .pmi-plan-delete {
  background: rgba(220, 53, 69, 0.2);
}

.pmi-plan-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.pmi-plan-status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.pmi-plan-status.status-active {
  background: #d4edda;
  color: #155724;
}

.pmi-plan-status.status-pending {
  background: #fff3cd;
  color: #856404;
}

.pmi-plan-date {
  font-size: 0.8rem;
  color: #888;
}

.pmi-plan-objective {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.pmi-plan-icon {
  font-size: 2rem;
}

.pmi-plan-label {
  font-size: 1.2rem;
  font-weight: 700;
  color: #333;
}

.pmi-plan-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 15px;
}

.pmi-plan-budget,
.pmi-plan-horizon {
  background: #f8f9fa;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
}

.pmi-plan-budget strong,
.pmi-plan-horizon strong {
  display: block;
  font-size: 1rem;
  color: #333;
}

.pmi-plan-budget span,
.pmi-plan-horizon span {
  font-size: 0.7rem;
  color: #888;
  text-transform: uppercase;
}

.pmi-plan-scenario {
  font-size: 0.85rem;
  color: #667eea;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pmi-plan-scenario i {
  color: #28a745;
}

/* Empty State */
.pmi-empty-state {
  text-align: center;
  padding: 40px 20px;
}

.pmi-empty-icon {
  font-size: 4rem;
  margin-bottom: 15px;
}

.pmi-empty-state h3 {
  margin: 0 0 10px 0;
  color: #333;
}

.pmi-empty-state p {
  color: #666;
  margin-bottom: 20px;
}

/* Loading State */
.pmi-loading {
  text-align: center;
  padding: 40px;
}

.pmi-loading p {
  margin-top: 15px;
  color: #666;
}

/* Dark Theme for Viewer */
[data-theme="dark"] .pmi-plan-card {
  background: #2d2d2d;
  border-color: #5f6368;
}

[data-theme="dark"] .pmi-plan-label {
  color: #e8eaed;
}

[data-theme="dark"] .pmi-plan-budget,
[data-theme="dark"] .pmi-plan-horizon {
  background: #3c4043;
}

[data-theme="dark"] .pmi-plan-budget strong,
[data-theme="dark"] .pmi-plan-horizon strong {
  color: #e8eaed;
}

[data-theme="dark"] .pmi-empty-state h3 {
  color: #e8eaed;
}

[data-theme="dark"] .pmi-empty-state p {
  color: #9aa0a6;
}

/* Dark theme for modal body and content areas */
[data-theme="dark"] .pmi-modal,
[data-theme="dark"] .pmi-viewer {
  background: #202124 !important;
  border-color: #3c4043;
}

[data-theme="dark"] .pmi-body {
  background: #202124 !important;
}

[data-theme="dark"] .pmi-scenario-card {
  background: #292b2f !important;
  border-color: #3c4043 !important;
}

[data-theme="dark"] .pmi-scenario-card.recommended {
  border-color: #667eea !important;
}

[data-theme="dark"] .pmi-scenario-name,
[data-theme="dark"] .pmi-scenario-desc {
  color: #e8eaed !important;
}

[data-theme="dark"] .pmi-scenario-metrics {
  border-color: #3c4043 !important;
}

/* Dark theme for distribution table */
[data-theme="dark"] .pmi-distribution-section {
  background: #202124 !important;
}

[data-theme="dark"] .pmi-distribution-section h3 {
  color: #e8eaed !important;
}

[data-theme="dark"] .pmi-distribution-table {
  background: #202124 !important;
}

[data-theme="dark"] .pmi-distribution-table th {
  background: #292b2f !important;
  color: #9aa0a6 !important;
  border-color: #3c4043 !important;
}

[data-theme="dark"] .pmi-distribution-table td {
  background: #202124 !important;
  color: #e8eaed !important;
  border-color: #3c4043 !important;
}

/* Dark theme for projections section */
[data-theme="dark"] .pmi-projections-section {
  background: #292b2f !important;
}

[data-theme="dark"] .pmi-projections-section h3 {
  color: #e8eaed !important;
}

[data-theme="dark"] .pmi-projection-item .value {
  color: #e8eaed !important;
}

[data-theme="dark"] .pmi-projection-item .label {
  color: #9aa0a6 !important;
}

/* Dark theme for justifications */
[data-theme="dark"] .pmi-justification-section {
  background: #202124 !important;
}

[data-theme="dark"] .pmi-justification-section h3 {
  color: #e8eaed !important;
}

[data-theme="dark"] .pmi-justification-item {
  color: #bdc1c6 !important;
}

/* Dark theme for footer */
[data-theme="dark"] .pmi-footer {
  background: #16181c !important;
  border-color: #3c4043 !important;
}

/* ===== CATEGORY SELECTION STYLES ===== */

.pmi-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 10px 0;
}

.pmi-category-card {
  background: white;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.pmi-category-card:hover {
  border-color: #667eea;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.pmi-category-card.selected {
  border-color: #667eea;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1),
    rgba(118, 75, 162, 0.1)
  );
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.pmi-category-card.selected::after {
  content: "\f00c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  top: 10px;
  right: 10px;
  color: #667eea;
  font-size: 14px;
}

.pmi-category-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.pmi-category-icon i {
  color: white;
  font-size: 24px;
}

.pmi-category-info h4 {
  margin: 0 0 6px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1a202c;
}

.pmi-category-info p {
  margin: 0;
  font-size: 0.8rem;
  color: #718096;
}

.pmi-category-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.pmi-category-badge.budget {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.pmi-category-badge.no-budget {
  background: rgba(99, 102, 241, 0.15);
  color: #4f46e5;
}

/* Hide badge when selected (checkmark shows instead) */
.pmi-category-card.selected .pmi-category-badge {
  display: none;
}

/* Dark theme for category cards */
[data-theme="dark"] .pmi-category-card {
  background: #292b2f !important;
  border-color: #3c4043 !important;
}

[data-theme="dark"] .pmi-category-card:hover {
  border-color: #667eea !important;
}

[data-theme="dark"] .pmi-category-card.selected {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.2),
    rgba(118, 75, 162, 0.2)
  ) !important;
}

[data-theme="dark"] .pmi-category-info h4 {
  color: #e8eaed !important;
}

[data-theme="dark"] .pmi-category-info p {
  color: #9aa0a6 !important;
}

/* ===== SMART PMI (IA) STYLES ===== */

/* Botão Gerar com IA */
.pmi-btn-ai {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  position: relative;
  overflow: hidden;
}

.pmi-btn-ai::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.pmi-btn-ai:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.pmi-btn-ai i {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Smart PMI Body */
.pmi-smart-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 25px;
}

/* Smart PMI Results Container */
.pmi-smart-results {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Resumo Executivo */
.pmi-ai-summary {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1) 0%,
    rgba(118, 75, 162, 0.1) 100%
  );
  border-radius: 12px;
  padding: 20px;
  border-left: 4px solid #667eea;
}

.pmi-ai-summary h4 {
  margin: 0 0 12px 0;
  color: #667eea;
  font-size: 1.1rem;
}

.pmi-ai-summary p {
  margin: 0;
  color: #444;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Análise */
.pmi-ai-analysis {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
}

.pmi-ai-analysis h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1rem;
}

.pmi-ai-analysis p {
  margin: 0 0 10px 0;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.5;
}

.pmi-ai-analysis p:last-child {
  margin-bottom: 0;
}

/* Alocação de Canais */
.pmi-ai-allocation {
  background: white;
  border: 1px solid #e1e5e9;
  border-radius: 12px;
  padding: 20px;
}

.pmi-ai-allocation h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1rem;
}

.pmi-ai-allocation .pmi-allocation-table {
  margin-bottom: 15px;
}

.pmi-total-allocated {
  text-align: right;
  margin: 10px 0 0 0;
  padding-top: 10px;
  border-top: 2px solid #667eea;
  color: #667eea;
  font-size: 1.1rem;
}

/* Previsões */
.pmi-ai-predictions {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 20px;
  color: white;
}

.pmi-ai-predictions h4 {
  margin: 0 0 15px 0;
  color: white;
  font-size: 1rem;
}

.pmi-ai-predictions .pmi-projections-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.pmi-ai-predictions .pmi-projection-item {
  text-align: center;
  background: rgba(255, 255, 255, 0.15);
  padding: 15px 10px;
  border-radius: 10px;
}

.pmi-ai-predictions .pmi-projection-value {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: white;
}

.pmi-ai-predictions .pmi-projection-label {
  font-size: 0.75rem;
  opacity: 0.9;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

/* Insights (Oportunidades e Riscos) */
.pmi-ai-insights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.pmi-opportunities {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1) 0%,
    rgba(5, 150, 105, 0.1) 100%
  );
  border-radius: 12px;
  padding: 20px;
  border-left: 4px solid #10b981;
}

.pmi-opportunities h5 {
  margin: 0 0 12px 0;
  color: #059669;
  font-size: 1rem;
}

.pmi-opportunities ul {
  margin: 0;
  padding-left: 20px;
}

.pmi-opportunities li {
  color: #065f46;
  font-size: 0.9rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.pmi-risks {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.1) 0%,
    rgba(220, 38, 38, 0.1) 100%
  );
  border-radius: 12px;
  padding: 20px;
  border-left: 4px solid #ef4444;
}

.pmi-risks h5 {
  margin: 0 0 12px 0;
  color: #dc2626;
  font-size: 1rem;
}

.pmi-risks ul {
  margin: 0;
  padding-left: 20px;
}

.pmi-risks li {
  color: #991b1b;
  font-size: 0.9rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Plano de Ação */
.pmi-ai-actions {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
}

.pmi-ai-actions h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1rem;
}

.pmi-ai-actions ol {
  margin: 0;
  padding-left: 25px;
}

.pmi-ai-actions li {
  color: #555;
  font-size: 0.9rem;
  margin-bottom: 10px;
  line-height: 1.5;
}

.action-priority {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 8px;
}

.action-priority.priority-1 {
  background: #ef4444;
  color: white;
}

.action-priority.priority-2 {
  background: #f59e0b;
  color: white;
}

.action-priority.priority-3 {
  background: #10b981;
  color: white;
}

.pmi-ai-actions li small {
  color: #888;
  font-style: italic;
}

/* Fontes de Dados */
.pmi-ai-sources {
  text-align: center;
  padding: 10px;
  background: rgba(102, 126, 234, 0.05);
  border-radius: 8px;
}

.pmi-ai-sources small {
  color: #667eea;
  font-size: 0.8rem;
}

/* Dark Theme para Smart PMI */
[data-theme="dark"] .pmi-ai-summary {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.2) 0%,
    rgba(118, 75, 162, 0.2) 100%
  );
}

[data-theme="dark"] .pmi-ai-summary p {
  color: #e8eaed;
}

[data-theme="dark"] .pmi-ai-analysis {
  background: #3c4043;
}

[data-theme="dark"] .pmi-ai-analysis h4 {
  color: #e8eaed;
}

[data-theme="dark"] .pmi-ai-analysis p {
  color: #9aa0a6;
}

[data-theme="dark"] .pmi-ai-allocation {
  background: #2d2d2d;
  border-color: #5f6368;
}

[data-theme="dark"] .pmi-ai-allocation h4 {
  color: #e8eaed;
}

[data-theme="dark"] .pmi-opportunities {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.2) 0%,
    rgba(5, 150, 105, 0.2) 100%
  );
}

[data-theme="dark"] .pmi-opportunities li {
  color: #6ee7b7;
}

[data-theme="dark"] .pmi-risks {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.2) 0%,
    rgba(220, 38, 38, 0.2) 100%
  );
}

[data-theme="dark"] .pmi-risks li {
  color: #fca5a5;
}

[data-theme="dark"] .pmi-ai-actions {
  background: #3c4043;
}

[data-theme="dark"] .pmi-ai-actions h4 {
  color: #e8eaed;
}

[data-theme="dark"] .pmi-ai-actions li {
  color: #9aa0a6;
}

[data-theme="dark"] .pmi-ai-sources {
  background: rgba(102, 126, 234, 0.15);
}

/* Responsivo */
@media (max-width: 768px) {
    .pmi-ai-insights {
        grid-template-columns: 1fr;
    }

    .pmi-ai-predictions .pmi-projections-grid {
        grid-template-columns: 1fr;
    }
}

/* Badge da categoria no cabeçalho */
.pmi-category-badge-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 10px;
    vertical-align: middle;
}

.pmi-category-badge-header i {
    font-size: 0.8rem;
}

/* ===== Reference Selection Step ===== */
.pmi-references-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pmi-reference-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px 20px;
    border: 1px solid #e9ecef;
}

.pmi-reference-section h4 {
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pmi-reference-section h4 i {
    color: #667eea;
    font-size: 0.9rem;
}

.pmi-reference-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.pmi-reference-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}

.pmi-reference-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.pmi-reference-item input[type="checkbox"],
.pmi-reference-item input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.pmi-ref-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}

.pmi-ref-score {
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pmi-ref-type {
    color: #666;
    font-size: 0.8rem;
}

.pmi-empty {
    color: #999;
    font-size: 0.85rem;
    font-style: italic;
    padding: 10px;
    text-align: center;
}

.pmi-loading {
    color: #667eea;
    font-size: 0.85rem;
    padding: 10px;
    text-align: center;
}

.pmi-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 15px;
    color: #856404;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.pmi-warning i {
    color: #ffc107;
    font-size: 1.1rem;
}

/* Dark theme support */
[data-theme="dark"] .pmi-reference-section {
    background: #2d3748;
    border-color: #4a5568;
}

[data-theme="dark"] .pmi-reference-section h4 {
    color: #e2e8f0;
}

[data-theme="dark"] .pmi-reference-item {
    background: #1a202c;
    border-color: #4a5568;
}

[data-theme="dark"] .pmi-reference-item:hover {
    background: #2d3748;
}

[data-theme="dark"] .pmi-ref-name {
    color: #e2e8f0;
}

[data-theme="dark"] .pmi-warning {
    background: #2d3748;
    border-color: #ffc107;
    color: #ffc107;
}
