// 🚨 ERROR MODAL COMPONENT STYLES
.error-modal {
  max-width: 600px;
  min-width: 400px;

  // 📱 RESPONSIVIDADE
  @media (max-width: 600px) {
    min-width: 320px;
    max-width: 95vw;
  }
}

// =======================================
// 🎯 HEADER DO MODAL
// =======================================
.modal-header {
  display: flex;
  align-items: center;
  padding: 24px 24px 16px 24px;
  border-bottom: 1px solid #e5e7eb;
  position: relative;

  .error-icon-container {
    margin-right: 16px;
    
    .error-icon {
      font-size: 32px;
      width: 32px;
      height: 32px;
      
      // 🎨 CORES BASEADAS NO TIPO
      &:has-text('warning') {
        color: #f59e0b; // Amarelo para validação
      }
      
      &:has-text('error') {
        color: #ef4444; // Vermelho para servidor
      }
      
      &:has-text('lock') {
        color: #6366f1; // Azul para auth
      }
      
      &:has-text('info') {
        color: #3b82f6; // Azul para info
      }
    }
  }

  .modal-title {
    flex: 1;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
  }

  .close-button {
    position: absolute;
    top: 8px;
    right: 8px;
    
    mat-icon {
      color: #6b7280;
    }
    
    &:hover mat-icon {
      color: #374151;
    }
  }
}

// =======================================
// 🎯 CONTEÚDO DO MODAL
// =======================================
.modal-content {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

.error-description {
  margin-bottom: 24px;
  
  p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #4b5563;
  }
}

// =======================================
// 🎯 LISTA DE ERROS
// =======================================
.error-list {
  margin-bottom: 24px;

  .list-title {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
  }

  .messages-list {
    list-style: none;
    padding: 0;
    margin: 0;
    
    .message-item {
      display: flex;
      align-items: flex-start;
      padding: 12px 16px;
      margin-bottom: 8px;
      background: #fef2f2;
      border: 1px solid #fecaca;
      border-radius: 8px;
      border-left: 4px solid #ef4444;
      
      .item-icon {
        color: #ef4444;
        font-size: 20px;
        width: 20px;
        height: 20px;
        margin-right: 12px;
        margin-top: 2px;
        flex-shrink: 0;
      }
      
      .message-text {
        font-size: 14px;
        line-height: 1.5;
        color: #7f1d1d;
        flex: 1;
      }
      
      &:last-child {
        margin-bottom: 0;
      }
    }
  }
}

// =======================================
// 🎯 INFORMAÇÕES TÉCNICAS
// =======================================
.technical-info {
  margin-top: 24px;
  border-top: 1px solid #e5e7eb;
  padding-top: 16px;

  .technical-toggle {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    transition: all 0.2s ease;
    
    &:hover {
      background: #f3f4f6;
      color: #374151;
    }
    
    mat-icon {
      margin-right: 8px;
      font-size: 18px;
      width: 18px;
      height: 18px;
    }
  }

  .technical-content {
    margin-top: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    
    .technical-text {
      margin: 0;
      font-family: 'Courier New', monospace;
      font-size: 12px;
      color: #374151;
      white-space: pre-wrap;
      word-wrap: break-word;
      max-height: 200px;
      overflow-y: auto;
    }
  }
}

// =======================================
// 🎯 AÇÕES DO MODAL
// =======================================
.modal-actions {
  padding: 16px 24px 24px 24px;
  border-top: 1px solid #e5e7eb;
  gap: 12px;

  .cancel-button {
    color: #6b7280;
    
    &:hover {
      background: #f3f4f6;
      color: #374151;
    }
  }

  .retry-button {
    color: #3b82f6;
    
    &:hover {
      background: #eff6ff;
    }
    
    mat-icon {
      margin-right: 8px;
      font-size: 18px;
      width: 18px;
      height: 18px;
    }
  }

  .primary-button {
    mat-icon {
      margin-right: 8px;
      font-size: 18px;
      width: 18px;
      height: 18px;
    }
  }
}

// =======================================
// 🌙 DARK MODE SUPPORT
// =======================================
@media (prefers-color-scheme: dark) {
  .error-modal {
    .modal-header {
      border-bottom-color: #374151;
      
      .modal-title {
        color: #f9fafb;
      }
      
      .close-button mat-icon {
        color: #9ca3af;
        
        &:hover {
          color: #d1d5db;
        }
      }
    }

    .modal-content {
      .error-description p {
        color: #d1d5db;
      }
      
      .error-list {
        .list-title {
          color: #f9fafb;
        }
        
        .messages-list .message-item {
          background: #450a0a;
          border-color: #7f1d1d;
          
          .message-text {
            color: #fca5a5;
          }
        }
      }
    }

    .technical-info {
      border-top-color: #374151;
      
      .technical-toggle {
        color: #9ca3af;
        
        &:hover {
          background: #374151;
          color: #d1d5db;
        }
      }
      
      .technical-content {
        background: #1f2937;
        border-color: #374151;
        
        .technical-text {
          color: #d1d5db;
        }
      }
    }

    .modal-actions {
      border-top-color: #374151;
      
      .cancel-button {
        color: #9ca3af;
        
        &:hover {
          background: #374151;
          color: #d1d5db;
        }
      }
      
      .retry-button {
        color: #60a5fa;
        
        &:hover {
          background: #1e3a8a;
        }
      }
    }
  }
}

// =======================================
// 🎯 ANIMAÇÕES
// =======================================
.error-modal {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
} 